home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 1 Issue 2
/
PDCD-1 - Issue 02.iso
/
_utilities
/
utilities
/
003
/
_threedee
/
!ThreeDee
/
ShellLibRT
(
.txt
)
< prev
next >
Wrap
RISC OS BBC BASIC V Source
|
1994-03-07
|
87KB
|
3,163 lines
>EvntShellSystem:ShellLib
Squished by Lofty's !Shrink vsn 3.01 on 07-Mar-94
shell_LibraryVersion:=1.31*&64
shell_Error:
EA%,NA$:
<>&D00
<>&903
&606C2:
shell_OSCheckVersion(3)
shell_FileExists("Resources:$.Resources.Edit.ThrowBack")
shell_Exit:
("Set Basic$File <"+
shell_GetAppName+"$BasicFile>"):
"Edit:ThrowBack"
shell_ErrorBox("Unexpected error:- "+
$+" Internal error code "+
$,"in "+
34+"EvntShellSystem:ShellLib"):
EA%>0
$,EA%-1)
shell_ErrorBox(NA$)
&606C2:
shell_OK(hA$):
&D00,hA$
shell_ErrorBox(UA$):
wA%,lA%:lA%=_shell_blk%:!lA%=
:$(lA%+4)=UA$+
=&D00
=&903
&600DF,lA%,17,"Message from "+
shell_GetAppName
&600DF,lA%,1,
shell_GetAppName
shell_GetLastSecureFileName:
c%:c%=_U%!80:
shell_GetString(nD%):
MA$,SC%:
((nD%?SC%)>31
SC%<&FF):MA$+=
(nD%?SC%):SC%+=1:
:=MA$
shell_GetEventHandler(b%,w%,jB%):
f%,j%,m%,q%,A$:
b%=-1
b%=-2
XNq%=
shell_HeapBlockInfo(_U%!&C)-8:f%=0:m%=
:j%=_U%!&C:A$="":
(j%!f%=b%)
j%!(f%+4)
j%!(f%+(&C+(jB%*4)))>&8000
f#A$=$(j%!(f%+(&C+(jB%*4)))):m%=
f%+=48
j%!(f%+4)=w%
j%!(f%+(&C+(jB%*4)))>&8000
s#A$=$(j%!(f%+(&C+(jB%*4)))):m%=
f%+=48
f%+=48
f%+=48
((f%>=q%)
m%):=A$
shell_GetEventMenu(pC%,b%,w%):
f%,j%,m%,q%,k%:
b%=-1
b%=-2
shell_HeapBlockInfo(_U%!&C)-8:f%=0:m%=
:j%=_U%!&C:A$="":
(j%!f%=b%)
shell_Tracef0("GetEventMenu:window handle matched.."):
j%!(f%+4)=w%
"k%=j%!(f%+8):
k%=-2
k%=_U%!&FC
:f%+=48:
(f%>=q%
m%):=k%
shell_GetEventListOffset(b%,g%,j%,RC%,JE%):
q%,f%,m%,d%,xB%,c%:
(!j%=0
(!j%=0)
:!j%=
shell_HeapBlockFetch(RC%):c%=!j%:c%!0=0:c%!4=0:=0
shell_HeapBlockInfo(!j%)-8:f%=0:m%=
:d%=-1:xB%=-1:c%=!j%:
xB%<0
(c%!f%=0
c%!f%+4=0)
xB%=f%
(c%!f%=b%)
g%=-1
d%=f%:m%=
shell_Tracef0("GetEventListOffset:icon handle is not -1"):
c%!(f%+4)=g%
d%=f%:m%=
f%+=RC%
f%+=RC%
((f%>=q%)
(d%=-1
xB%<0
Id%=q%:!j%=
shell_HeapBlockExtend(!j%,RC%):c%=!j%:c%+=d%:c%!0=0:c%!4=0
d%=xB%
shell_AttachPane(b%,
cC%,i%,rA%,tA%):
a%,d%,c%,BB%,GD%:
shell_Tracef0("AttachPane:Attaching Pane Handler"):GD%=
shell_WindowGetFlags(cC%):
1<<5)=0
shell_Tracef0("AttachPane:'Pane' bit of pane window is not set, fixing.."):
shell_WindowToggleFlags(cC%,1<<5)
1<<1)
shell_Tracef0("AttachPane:'Moveable' bit of pane window is set, fixing.."):
shell_WindowToggleFlags(cC%,1<<1)
shell_GetEventListOffset(b%,-1,_U%+92,24,
shell_Tracef0("AttachPane:Creating pane event block"):d%=
shell_GetEventListOffset(b%,-1,_U%+92,24,
):a%=_U%!92+d%:a%!0=b%:a%!4=-1:a%!8=
shell_HeapBlockFetch(4):a%!&C=
shell_HeapBlockFetch(4):a%!16=
shell_HeapBlockFetch(4)
aa%!20=
shell_HeapBlockFetch(4):c%=a%!8:!c%=-1:c%=a%!&C:!c%=-1:c%=a%!16:!c%=-1:c%=a%!20:!c%=-1
:a%=_U%!92+d%:c%=a%!8:e%=0:BB%=0:
c%!e%<>-1:e%+=4:BB%+=1:
:a%!8=
shell_HeapBlockExtend(a%!8,4):c%=a%!8:c%!(BB%*4)=cC%:c%!((BB%+1)*4)=-1:a%!&C=
shell_HeapBlockExtend(a%!&C,4):c%=a%!&C:c%!(BB%*4)=i%:c%!((BB%+1)*4)=-1
a%!16=
shell_HeapBlockExtend(a%!16,4):c%=a%!16:c%!(BB%*4)=rA%:c%!((BB%+1)*4)=-1:a%!20=
shell_HeapBlockExtend(a%!20,4):c%=a%!20:c%!(BB%*4)=tA%:c%!((BB%+1)*4)=-1:
shell_AttachDataLoad(b%,g%,u%,A$,RF%):
a%,c%,d%,N$:
shell_Tracef0("AttachDataLoad:Attaching DataLoad Handler"):
b%=-1
b%=-2
u%=u%
1<<31
0Pd%=
shell_GetEventListOffset(b%,g%,_U%+96,16,
):a%=_U%!96+d%:
a%!0=0
a%!4=0
shell_Tracef0("AttachDataLoad:This is the first DataLoad Event..."):a%!0=b%:a%!4=g%:a%!8=
shell_HeapBlockFetch(8):c%=a%!8:c%!0=u%:c%!4=-1:a%!&C=
shell_HeapBlockFetch(8):c%=a%!&C:c%!0=
shell_HeapBlockFetch(
(A$)+1):c%!4=-1:c%=c%!0:$c%=A$
shell_Tracef0("AttachDataLoad:This is another DataLoad Event..."):a%!8=
shell_HeapBlockExtend(a%!8,4):a%!&C=
shell_HeapBlockExtend(a%!&C,4):e%=0:c%=a%!8:
c%!e%<>-1:e%+=4:
:c%!e%=u%:c%!(e%+4)=-1:c%=a%!&C:c%!e%=
shell_HeapBlockFetch(
A$+1)
c%=c%!e%:$c%=A$
shell_GetCmdLineArgs:
shell_Tracef0("AttachDataLoad:cmdline ="+N$):
shell_Tracef0("AttachDataLoad:flag bit ="+
((_U%!&64
1<<5))):
shell_Tracef0("AttachDataLoad:wh% ="+
~b%):
shell_Tracef0("AttachDataLoad:type% ="+
N$<>""
(_U%!&64
1<<5)
1<<31
c%=u%
1<<31
c%=u%
shell_FileType(N$)=c%
shell_Tracef0("AttachDataLoad:Loading file.."):
shell_MessageSendDataLoad(c%,N$):_U%!&64=_U%!&64
(1<<5)
shell_AttachDataSave(b%,g%,xA%,u%,QC%,A$):
a%,c%,d%:
shell_IconIsSprite(b%,g%)
shell_OK(
shell_MessageNoArgs("SHELLMSG29"))
shell_IconSetButtonType(b%,g%,6):
xA%=0
xA%=&64
shell_Tracef0("AttachDataSave:Attaching DataSave Handler to icon "+
g%+" in window &"+
~b%):
shell_Tracef0("AttachDataSave:Handler function is '"+A$+"'"):d%=
shell_GetEventListOffset(b%,g%,_U%+72,24,
):a%=_U%!72+d%:a%!0=b%:a%!4=g%:a%!8=xA%:a%!&C=u%
uHa%!16=QC%:a%!20=
shell_HeapBlockFetch(
(A$)+1):c%=a%!20:$c%=A$:
&FF9:
xA%>&8000
}'_U%!&88=
shell_HeapBlockInfo(xA%)-8
_U%!&88=xA%
xA%>&8000
'_U%!&88=
shell_HeapBlockInfo(xA%)-4
_U%!&88=xA%
:_U%!&8C=u%:_U%!&90=xA%:
shell_AttachMenu(b%,w%,k%,mB%,gB%,_B%):
w%>=0
shell_IconSetButtonType(b%,w%,3)
shell_Tracef0("AttachMenu:Attaching menu handle &"+
~k%+" to window handle &"+
~b%):
shell_EventAdd(b%,w%,0,k%,""):
shell_AttachMenuMaker(b%,w%,A$):
shell_Tracef0("AttachMenuMaker:Attaching menumaker function '"+A$+"'"):
shell_EventAdd(b%,w%,1,0,A$):
shell_AttachMenuDBox(CB%,M$,TA$,SA$):
a%,c%,nA%:
shell_WindowLoaded(M$)
shell_MessageOneArg("SHELLMSG03",M$)
shell_HeapBlockFetch(&C):a%!0=
shell_HeapBlockFetch(
M$+1):c%=a%!0:$c%=M$:a%!4=
shell_HeapBlockFetch(
TA$+1):c%=a%!4:$c%=TA$:a%!8=
shell_HeapBlockFetch(
SA$+1):c%=a%!8:$c%=SA$:
&45BCE,CB%,a%:
&45BCC,,
shell_AttachClickSelect(b%,w%,A$):
shell_EventAdd(b%,w%,2,0,A$):
shell_AttachClickAdjust(b%,w%,A$):
shell_EventAdd(b%,w%,3,0,A$):
shell_AttachUserRedraw(
b%,A$):
a%,JA%,SA%:a%=
shell_HeapBlockFetch(40):!a%=b%:
&400CB,,a%:JA%=a%!32:
shell_HeapBlockReturn(a%):
shell_Tracef0("AttachUserRedraw:flag%=&"+
~JA%):
1<<4)
shell_Tracef0("AttachUserRedraw:auto redraw set!!"):SA%=b%:
shell_WindowToggleFlags(b%,1<<4):
b%<>SA%
shell_UpdateWindowHandle(SA%,b%)
shell_EventAdd(b%,-1,4,0,A$):
shell_AttachDrag(b%,w%,jF%,A$):
shell_EventAdd(b%,w%,6,0,A$):
shell_AttachHelpTag(b%,w%,I$):
shell_EventAdd(b%,w%,8,0,I$):
shell_EventAdd(b%,w%,jB%,k%,A$):
f%,dB%,j%,q%,m%:
NC%:f%=0:m%=
b%=-1
b%=-2
shell_HeapBlockInfo(_U%!&C)-8:j%=_U%!&C:
(j%!f%=b%)
j%!(f%+4)=w%
f%+=48
f%+=48
(f%>=q%
%f%=0:
(j%!f%<>0):f%+=48:
f%>=q%
_U%!&C=
shell_HeapBlockExtend(_U%!&C,48):j%=_U%!&C:j%!(f%+0)=0:j%!(f%+4)=0:j%!(f%+8)=0:j%!(f%+&C)=0:j%!(f%+16)=0:j%!(f%+20)=0:j%!(f%+24)=0:j%!(f%+28)=0:j%!(f%+32)=0:j%!(f%+36)=0:j%!(f%+40)=0:j%!(f%+44)=0
:j%!(f%+0)=b%:j%!(f%+4)=w%:
k%<>0
j%!(f%+8)=k%
:NC%=f%+(&C+(jB%*4)):
j%!NC%<>0
shell_HeapBlockReturn(j%!NC%)
:dB%=
shell_HeapBlockFetch(
A$+1):$dB%=A$:j%!NC%=dB%:
shell_EventDeleteAll(b%):
f%,k%,m%,q%,j%,r%:f%=0:k%=0:m%=
b%=-1
b%=-2
.>q%=
shell_HeapBlockInfo(_U%!&C)-8:j%=_U%!&C:
(j%!f%=b%)
f%+=48
(f%>=q%
8Cj%!(f%+0)=0:j%!(f%+4)=0:j%!(f%+8)=0:
r%=&C
j%!(f%+r%)<>0
shell_HeapBlockReturn(j%!(f%+r%)):j%!(f%+r%)=0
shell_Tracef0("EventDeleteAll:wh%=&"+
~b%):
shell_DeleteEventDataSave(b%,-1):
shell_DeleteEventBump(b%,-1):
shell_DeleteEventBump(b%,g%):
d%,a%,q%,j%,c%:j%=_U%!&68:
shell_GetEventListOffset(b%,g%,_U%+&68,16,
shell_Tracef0("DeleteEventBump:offset%="+
d%>=0
g%=-1
shell_Tracef0("DeleteEventBump:Deleting Bump Event (all events for window handle &"+
~b%+")")
shell_Tracef0("DeleteEventBump:Deleting Bump Event (window handle was &"+
~b%+" icon handle was "+
g%+")")
shell_HeapBlockInfo(_U%!&68)-8:
d%=q%-16
HA%=j%!&C:c%=HA%!&C:
shell_HeapBlockReturn(c%!&C):
shell_HeapBlockReturn(c%!16):
shell_HeapBlockReturn(c%):
shell_HeapBlockReturn(_U%!&68):_U%!&68=0:
shell_Tracef0("DeleteEventDataSave:No Bump events now registered")
_U%!&68=
shell_HeapBlockExtend(_U%!&68,-16)
a%=j%+d%:a%!0=0:a%!4=0:a%!8=0:HA%=a%!&C:
shell_HeapBlockReturn(HA%!&C):
shell_HeapBlockReturn(HA%!16):
shell_HeapBlockReturn(HA%)
d%<0:
shell_DeleteEventDataSave(b%,g%):
d%,a%,q%:
shell_GetEventListOffset(b%,g%,_U%+72,24,
d%>=0
g%=-1
shell_Tracef0("DeleteEventDataSave:Deleting DataSave Event (all events for window handle &"+
~b%+")")
shell_Tracef0("DeleteEventDataSave:Deleting DataSave Event (window handle was &"+
~b%+" icon handle was "+
g%+")")
shell_HeapBlockInfo(_U%!72)-8:
d%=q%-24
shell_HeapBlockReturn(_U%!72):_U%!72=0:
shell_Tracef0("DeleteEventDataSave:No DataSave events now registered")
_U%!72=
shell_HeapBlockExtend(_U%!72,-24)
a%=j%+d%:a%!0=0:a%!4=0:a%!8=0:a%!&C=0:a%!16=0:
shell_HeapBlockReturn(a%!20):a%!20=0
d%<0:
shell_MessageNoArgs(I$):=
shell_MessageLookup(I$,"","")
shell_MessageOneArg(I$,r$):=
shell_MessageLookup(I$,r$,"")
shell_MessageLookup(I$,r$,fA$):
i%,L%,f$,yB%,YB%:
I$,8)="SHELLMSG"
yB%=_U%!284:YB%=_U%!280
yB%=_U%!64:YB%=_U%!68
&61502,YB%,I$,yB%,256,r$,fA$
,,,L%;i%:
yB%?L%=&D:f$=$(yB%)
shell_WimpInit(HC%,AA$):
&400C0,HC%,&4B534154,AA$
HC%,YA%:
_U%!&64
"WimpExt_Initialise",&E,YA%
:_U%!&94=YA%:=YA%
shell_WimpInit_I(HC%,AA$):
&400C0,HC%,&4B534154,AA$
HC%,YA%:
_U%!&64
"WimpExt_Initialise",&E,YA%
:_U%!&94=YA%:
"Interface_Initialise",YA%:=YA%
shell_WimpCloseDown_I(YA%):
shell_LoseFonts:
_U%!&F0<>-1
"XFontMenu_Release"
_U%!&64
"WimpExt_Initialise",&E,YA%
&600DD,YA%,&4B534154:
"XInterface_CloseDown",YA%:
_U%!&64
"XImpulse_CloseDown",_U%!&94
WimpCloseDown(YA%):
shell_LoseFonts:
_U%!&F0<>-1
"XFontMenu_Release"
_U%!&64
"WimpExt_Initialise",&E,YA%
&600DD,YA%,&4B534154:
_U%!&64
"XImpulse_CloseDown",_U%!&94
("Unset "+_shell_AppName$+"$BasicFile"):
shell_LoseFonts:
r%,c%:c%=_U%!&E8:
c%?r%>0:
&40082,r%:c%?r%-=1:
shell_FindFont(b$,yE%):
JA%,zC%:zC%=_U%!&E8:
&40081,,b$,yE%*16,c*16,0,0
JA%:zC%?JA%+=1:
zC%?JA%>=&FF
shell_OK(
shell_MessageNoArgs("SHELLMSG18"))
shell_Init:
cA%,r%,c%,N$:
hA%,D$,E$:
_U%330,_shell_blk%260:_Q%=
shell_HeapBlockFetch(&BB8):cA%=
shell_HeapBlockFetch(48):cA%!0=0:cA%!4=0:cA%!8=0:cA%!&C=0:cA%!16=0:cA%!20=0:cA%!24=0:cA%!28=0:cA%!32=0:cA%!36=0:cA%!40=0:cA%!44=0:_U%!0=0:_U%!4=0:_U%!8=0
_U%!&C=cA%:_U%!16=1:_U%!20=0:_U%!24=0:_U%!28=0:_U%!32=0:_U%!36=0:_U%!40=0:_U%!44=-1:_U%!48=0:_U%!52=0:_U%!56=0:_U%!60=0:_U%!64=0:_U%!68=0:_U%!72=0:_U%!76=
shell_HeapBlockFetch(256):_U%!80=0:_U%!84=-1:_U%!88=0:_U%!92=0:_U%!96=0:_U%!&64=0:_U%!&68=0
_U%!&6C=-1:_U%!&70=-1:_U%!&74=-1:_U%!&78=-1:_U%!&7C=-1:_U%!&80=0:_U%!&84=0:_U%!&88=-1:_U%!&8C=-1:_U%!&90=-1:_U%!&94=0:_U%!&98=0:_U%!&9C=0:_U%!&A0=0:_U%!&A4=0:_U%!&A8=0:_U%!&AC=0:_U%!&B0=0:_U%!&B4=0:_U%!&B8=0:_U%!&BC=0:_U%!&C0=0:_U%!&C4=0:_U%!&C8=0
_U%!&CC=0:_U%!&D0=-1:_U%!&D4=-1:_U%!&D8=0:_U%!&DC=0:_U%!&E0=0:_U%!&E4=0:_U%!&E8=
shell_HeapBlockFetch(256):_U%!&EC=
shell_HeapBlockFetch(256):_U%!&F0=-1:_U%!&F4=0:_U%!&F8=0:_U%!&FC=0:_U%!256=0:_U%!260=1:_U%!264=0:_U%!268=0:_U%!272=0:_U%!276=0
_U%!280=0:_U%!284=0:_U%!288=-1:_U%!292=-1:_U%!296=-1:_U%!300=0:_U%!304=0:_U%!308=0:_U%!312=0:_U%!316=0:_U%!320=0:_U%!324=0:
shell_MemFill(_U%!&E8,256,0):
shell_MemFill(_U%!&EC,256,0):hA%=
shell_HeapBlockFetch(256)
shell_OSVarGetVal(hA%,256,"Obey$Dir",1):
shell_HeapBlockReturn(hA%):E$=
shell_Leaf(D$),2):_U%!&BC=
shell_HeapBlockFetch((
D$)+1):_U%!&C4=
shell_HeapBlockFetch((
E$)+1):c%=_U%!&BC:$c%=D$:c%=_U%!&C4:$c%=E$:N$=
shell_OSReadCommandArg(1):
N$<>""
L_U%!&64=_U%!&64
1<<5:c%=
shell_HeapBlockFetch(
N$+1):$(c%)=N$:_U%!324=c%
shell_OSModuleCheckVersion("WimpExtension",1.98):
_U%!&64=_U%!&64
RO3_Present:
_U%!&64=_U%!&64
1<<&A
shell_GetCmdLineArgs:
_U%!324<>0
N$=$(_U%!324)
shell_Tracef0("GetCmdLineArgs:cmdline was "+N$):=N$
shell_FileType(Z$):
8,5,Z$
,,u%:u%=(u%
&FFF00)>>>8:=u%
shell_FileExists(Z$):
shell_CatInfoRead(Z$)="Not Found":=
shell_CatInfoRead(Z$):
u%,YC%,fC%,vA%,pB%,B$:
8,5,Z$
u%,,YC%,fC%,vA%,pB%:
="Not Found"
pB%=51
B$+="WR "
pB%=&BB
B$+="LWR"
pB%=&88
B$+="DL "
B$+=" "+
shell_StringPadLeading(
~YC%,"0",8):B$+=" "+
shell_StringPadLeading(
~fC%,"0",8):B$+=" "+
shell_StringPadLeading(
~vA%,"0",8):=B$
shell_GetAppDir:
c%:c%=_U%!&BC:=$c%
shell_GetAppDataDir:
c%:c%=_U%!&C0:=$c%
shell_GetAppName:
c%:c%=_U%!&C4:=$c%
shell_ResourcesInit:
_$,c%,E$,D$:
hA%,cB%,LC%:E$=
shell_GetAppName:D$=
shell_GetAppDir:hA%=
shell_HeapBlockFetch(256):
shell_OSVarExists(hA%,E$+"Res$Path")
_U%!&64=_U%!&64
shell_OSVarExists(hA%,E$+"Data$Dir")
shell_OSVarGetVal(hA%,256,E$+"Data$Dir",1):_U%!&C0=
shell_HeapBlockFetch((
_$)+1):c%=_U%!&C0:$c%=_$
_U%!&C0=
shell_HeapBlockFetch((
D$)+1):c%=_U%!&C0:$c%=D$
_U%!&64
shell_FileExists(E$+"Res:Messages")
shell_MessagesInit(E$+"Res:Messages",_U%!68,_U%!64)
shell_FileExists(E$+"Res:ShellMsgs")
shell_MessagesInit(E$+"Res:ShellMsgs",_U%!280,_U%!284)
shell_MessagesInit("ShellSysRes:ShellMsgs",_U%!280,_U%!284)
&20035,-1,4
,,LC%:
&20035,-1,5
,,cB%:
cB%=1
shell_FileExists(E$+"Res:Sprites22")
4_U%!16=
shell_SpriteAreaLoad(E$+"Res:Sprites22")
shell_FileExists(E$+"Res:Sprites")
2_U%!16=
shell_SpriteAreaLoad(E$+"Res:Sprites")
_U%!16=1
shell_FileExists(E$+"Res:Templates")
shell_TemplatesInit(E$+"Res:Templates")
shell_FileExists(D$+".Messages")
shell_MessagesInit(D$+".Messages",_U%!68,_U%!64)
shell_FileExists(D$+".ShellMsgs")
shell_MessagesInit(D$+".ShellMsgs",_U%!280,_U%!284)
shell_MessagesInit("ShellSysRes:ShellMsgs",_U%!280,_U%!284)
&20035,-1,4
,,LC%:
&20035,-1,5
,,cB%:
cB%=1
shell_FileExists(D$+".Sprites22")
/1_U%!16=
shell_SpriteAreaLoad(D$+".Sprites22")
shell_FileExists(D$+".Sprites")
2/_U%!16=
shell_SpriteAreaLoad(D$+".Sprites")
_U%!16=1
shell_FileExists(D$+".Templates")
shell_TemplatesInit(D$+".Templates")
&45BC0:
shell_HeapBlockReturn(_Q%):_Q%=
shell_HeapBlockFetch(&400):
shell_HeapBlockReturn(hA%):
shell_SpriteAreaLoad(F$):
FB%,S%,T%:S%=
(F$):T%=
#S%+16:
#S%:FB%=
shell_HeapBlockFetch(T%):!FB%=T%:FB%!4=0:FB%!8=16:FB%!&C=16:
46,521,FB%:
46,522,FB%,F$:
shell_Tracef0("SpriteLoad:Sprite file loaded at &"+
~FB%):=FB%
shell_UserSpritesBase:=_U%!16
shell_SpriteGetPtr(qB%,Q$):
KB%,f%:KB%=
shell_HeapBlockFetch(21):$KB%=Q$:
46,280,qB%,KB%
,,f%:
shell_HeapBlockReturn(KB%):=f%
shell_TemplatesInit(F$):
sB%,_C%,hE%,X%,f%,iB%:
uD%,EA%,XC%,Q$,iA%,zD%,BA%:
jA%,TC%,BE%,VC%,jA$,CA%:XC%=
shell_HeapBlockFetch(20):EA%=0:iA%=0:uD%=
shell_FileLength(F$):WE%=
shell_HeapBlockFetch(uD%):sB%=WE%:
shell_TemplateFileInfo(F$,iB%,iA%,BA%)
BA%=0
u|_U%!4=
shell_HeapBlockFetch(20*iA%):UE%=
shell_HeapBlockFetch(iB%):_C%=UE%:hE%=UE%+iB%:iA%=0:
&600D9,,F$
;zD%:
shell_MessageTwoArgs("SHELLMSG34","template",F$)
:$XC%="*":
&400DB,,sB%,_C%,hE%,_U%!&E8,XC%,EA%
,,_C%,,,Q$,EA%:
EA%<>0
!((_U%!4)+(16*iA%))=sB%:$(((_U%!4)+(16*iA%))+4)=Q$:
shell_Tracef0("TemplatesInit: Template Loaded: "+Q$):sB%+=(88+(sB%!84)*32):iA%+=1
EA%=0:
&400DA:_U%!0=iA%:
shell_Tracef0("TemplatesInit:Templates resource file loaded at &"+
~WE%+" ("+
iA%+" templates)"):
shell_Tracef0("TemplatesInit:Indirected buffer size used for loading &"+
~iB%)
shell_MessageTwoArgs("SHELLMSG35","template",F$)
shell_MessageTwoArgs("SHELLMSG36",F$,"template")
shell_HeapBlockReturn(XC%):
shell_WindowLoaded(M$):
r%,m%:
(M$)>&C
shell_MessageOneArg("SHELLMSG02",M$)
(_U%!0)-1:
$(((_U%!4)+(16*r%))+4)=M$
:r%=(_U%!0)-1
r%:=m%
shell_GetWB(M$):
r%,m%:
(M$)>&C
shell_MessageOneArg("SHELLMSG02",M$)
5m%=-1:
(_U%!0)-1:
$(((_U%!4)+(16*r%))+4)=M$
m%=r%:r%=(_U%!0)-1
m%>-1
=!((_U%!4)+(16*m%))
shell_MessageOneArg("SHELLMSG03",M$)
shell_MessageExpand(d$):
L$,f$,qA%:L$="":
d$,"\")>0:qA%=
d$,"\"):L$+=
d$,qA%-1):f$=
d$,qA%+1,1):d$=
d$,qA%+2):
"A":L$+="Click ADJUST to"
"a":L$+="ADJUST"
"D":L$+="Drag with SELECT to"
"d":L$+="Drag with ADJUST to"
"G":L$+="This option is greyed out because"
"R":L$+="Move the pointer right"
"S":L$+="Click SELECT to"
"s":L$+="SELECT"
"T":L$+="This is the"
"W":L$+="This window is"
"w":L$+="window"
L$+="\"+f$
:=L$+d$
shell_OpenMenu(OA%,PA%,kA%):
A$:A$=
shell_GetEventHandler(_U%!28,_U%!32,1):
A$<>""
shell_Tracef0("OpenMenu:About to call "+"FN"+A$+"("+
_U%!28+","+
_U%!32+")"):o%=
("FN"+A$+"(_U%!28,_U%!32)")
shell_Tracef0("OpenMenu:no menumaker function registered")
kA%<>_U%!24
shell_HeapBlockExists(_U%!256)
shell_HeapBlockReturn(_U%!256):_U%!256=0
shell_HeapBlockExists(_U%!&F4)
shell_HeapBlockReturn(_U%!&F4):_U%!&F4=0
kA%=_U%!&FC
&400D4,,kA%,OA%-64,PA%:_U%!264=1
_Q%!0=OA%:_Q%!4=PA%:
&45BC5,kA%,_Q%:_U%!264=0
:_U%!24=kA%:_U%!36=OA%:_U%!40=PA%:_U%!52=_U%!28:_U%!56=_U%!32:
shell_MenuLastXPos:=_U%!36
shell_MenuLastYPos:=_U%!40
shell_MenuAttachDbox(a$):
"Menu_SetSubHandle",_U%!8,
shell_MenuString(a$),1:
shell_Tracef0("MenuAttachDbox:Dialog box ("+a$+") attached"):
shell_MessageWindow(H$,qE%,XA$,m$):
uC%,lA%:lA%=
shell_HeapBlockFetch(260):!lA%=0:$(lA%+4)=H$+
m$=""
m$="Message from "+XA$
&400DF,lA%,19,m$
&400DF,lA%,17,m$
shell_HeapBlockReturn(lA%):=uC%
shell_CreateWindow(CA$,
WB%:WB%=
shell_GetWB(CA$):WB%!64=_U%!16:
&400C1,,WB%
shell_CreateWindow2(N,i%,oE%,MF%,OF%,dA%,dD%,eA%,wA%,DB%):
Q%:Q%=
shell_HeapBlockFetch(&BB8):Q%!0=dD%:Q%!4=eA%:Q%!8=wA%:Q%!&C=DB%:Q%!16=0:Q%!20=0:Q%!24=-1:Q%!28=i%:Q%?32=7:Q%?33=2:Q%?34=oE%:Q%?35=MF%:Q%?36=3:Q%?37=1:Q%?38=2:Q%?39=0:Q%!40=0:Q%!44=dA%
Q%!48=OF%:Q%!52=0:Q%!56=317:Q%!60=&3000:Q%!68=1:Q%!72=N:Q%!76=-1:Q%!80=
$N:Q%!84=0:
&400C1,,Q%
shell_HeapBlockReturn(Q%):=h%
shell_WindowHasTitleBar(b%):=(
shell_WindowGetFlags(b%)
1<<26)
shell_WindowIsMoveable(b%):=(
shell_WindowGetFlags(b%)
1<<1)
shell_WindowIsAPane(b%):=(
shell_WindowGetFlags(b%)
1<<5)
shell_WindowIsNotBounded(b%):=(
shell_WindowGetFlags(b%)
1<<6)
shell_WindowTrapsHotKeys(b%):=(
shell_WindowGetFlags(b%)
1<<&C)
shell_WindowIsOpen(b%):=(
shell_WindowGetFlags(b%)
1<<16)
shell_WindowIsOnTop(b%):=(
shell_WindowGetFlags(b%)
1<<17)
shell_WindowHasBeenToggled(b%):=(
shell_WindowGetFlags(b%)
1<<18)
shell_WindowHasInputFocus(b%):=(
shell_WindowGetFlags(b%)
1<<20)
shell_WindowHasBackIcon(b%):=(
shell_WindowGetFlags(b%)
1<<24)
shell_WindowHasCloseIcon(b%):=(
shell_WindowGetFlags(b%)
1<<25)
shell_WindowHasToggleIcon(b%):=(
shell_WindowGetFlags(b%)
1<<27)
shell_WindowHasVScrollBar(b%):=(
shell_WindowGetFlags(b%)
1<<28)
shell_WindowHasAdjustSizeIcon(b%):=(
shell_WindowGetFlags(b%)
1<<29)
shell_WindowHasHScrollBar(b%):=(
shell_WindowGetFlags(b%)
1<<30)
shell_WindowGetFlags(b%):
i%,a%:a%=
shell_HeapBlockFetch(36):a%!0=b%:
&400CB,,a%:i%=a%!32:
shell_HeapBlockReturn(a%):=i%
shell_WindowGetTitleFlags(b%):
i%,a%:a%=
shell_HeapBlockFetch(&64+(
shell_WindowCountIcons(b%)*32)):a%!0=b%:
&400CC,,a%:i%=a%!60:
shell_HeapBlockReturn(a%):=i%
shell_IconGetFlags(b%,g%):
i%,a%:a%=
shell_HeapBlockFetch(50):a%!0=b%:a%!4=g%:
&400CE,,a%:i%=a%!24:
shell_HeapBlockReturn(a%):=i%
shell_WindowTitleFlags(b%):
i%,a%:a%=
shell_HeapBlockFetch(&64+(
shell_WindowCountIcons(b%)*32)):a%!0=b%:
&400CC,,a%:i%=a%!60:
shell_HeapBlockReturn(a%):=i%
shell_WindowTitleHasBorder(b%):=(
shell_WindowTitleFlags(b%)
1<<2)
shell_WindowTitleIsSprite(b%):=(
shell_WindowTitleFlags(b%)
1<<1)
shell_WindowTitleIsText(b%):=(
shell_WindowTitleFlags(b%)
1<<0)
shell_WindowTitleIsHCentred(b%):=(
shell_WindowTitleFlags(b%)
1<<3)
shell_WindowTitleIsVCentred(b%):=(
shell_WindowTitleFlags(b%)
1<<4)
shell_WindowTitleIsFilled(b%):=(
shell_WindowTitleFlags(b%)
1<<5)
shell_WindowTitleIsAAliased(b%):=(
shell_WindowTitleFlags(b%)
1<<6)
shell_WindowTitleIsIndirected(b%):=(
shell_WindowTitleFlags(b%)
1<<8)
shell_WindowGetTitle(b%):
R$,a%:a%=
shell_HeapBlockFetch(&64+(
shell_WindowCountIcons(b%)*32)):a%!0=b%:
&400CC,,a%:
(a%!32
1<<26)
((a%!60)
256)=0
R$=$(a%+76)
R$=$(!(a%+76))
shell_HeapBlockReturn(a%):=R$
shell_WindowTitleBufferLength(b%):
BA%,a%:a%=
shell_HeapBlockFetch(&64+(
shell_WindowCountIcons(b%)*32)):a%!0=b%:
&400CC,,a%:
((a%!60)
256)=0
BA%=&C
BA%=a%!84
shell_HeapBlockReturn(a%):=BA%
shell_WindowMoveToIcon(b%,ID%,g%,rA%,tA%):
n%,s%:n%=
shell_HeapBlockFetch(50):s%=
shell_HeapBlockFetch(36):s%!20=0:
shell_OSCheckVersion(3)
ID%=-1
!s%=-2
!s%=ID%
&400CB,,s%
:n%!0=ID%:n%!4=g%:
&400CE,,n%:
shell_WindowMoveTo(b%,n%!8+rA%-s%!20,n%!20+tA%):
shell_HeapBlockReturn(n%):
shell_HeapBlockReturn(s%):
shell_WindowMoveTo(b%,OA%,PA%):
yD%,dE%,d%,a%:a%=
shell_HeapBlockFetch(&64+(
shell_WindowCountIcons(b%)*32)):a%!0=b%:
&400CC,,a%:yD%=a%!&C-a%!4:dE%=a%!16-a%!8:a%!4=OA%:a%!8=PA%:a%!&C=OA%+yD%:a%!16=PA%+dE%:
&400C5,,a%:
&400C6,,a%
P.d%=
shell_SearchStatic(_U%!&B8,b%):
d%>-1
shell_OpenWindowStatic(b%)
shell_OpenWindowDynamic(b%,0,0)
shell_HeapBlockReturn(a%):
shell_WindowBringToTop(b%):
PB%:PB%=
shell_HeapBlockFetch(256):PB%!0=b%:
&400CB,,PB%:PB%!28=-1:
&400E7,2,PB%,b%:
&400C7,0,PB%:
shell_HeapBlockReturn(PB%):
shell_UpdateWindow(h%,dD%,eA%,wA%,DB%):
a%:a%=
shell_HeapBlockFetch(a%):a%!0=h%:a%!4=dD%:a%!8=eA%:a%!&C=wA%:a%!16=DB%:
&400C9,,a%
&400CB,,a%:
shell_HeapBlockReturn(a%):
shell_OpenWindowDynamic(b%,rA%,tA%):
o%,wB%:wB%=
shell_HeapBlockFetch(20):_U%!20=b%:
&400CF,,wB%:
&400D4,,b%,wB%!0+rA%,wB%!4+tA%:
shell_HeapBlockReturn(wB%):
shell_ClaimKeypress:
_U%!20<>0
&400D4,,-1:o%=
shell_DeleteWindow(_U%!20):_U%!20=0
shell_OpenWindow(b%,ED%,xD%):
d%,a%,t%,e%,jE%,UC%,QA%,mA%:
CC%,JC%,DB%,XE%,kE%,EC%:d%=
shell_GetEventListOffset(b%,-1,_U%+304,&C,
d%>=0
ga%=_U%!304+d%:c%=a%!8:
shell_Tracef0("OpenWindow:About to call "+"FN"+$c%):EC%=
("FN"+$c%):
EC%=0
:JC%=
:DB%=
shell_HeapBlockFetch(&64):DB%!0=b%:
&400CB,,DB%:
(DB%!32
&80000)=&80000
shell_HeapBlockReturn(DB%):_Q%!0=b%:
&400CB,,_Q%
&400C5,,_Q%
shell_GetEventListOffset(b%,-1,_U%+92,24,
d%>-1
Ya%=(_U%!92)+d%:eB%=a%!8:jD%=a%!&C:QB%=a%!16:fB%=a%!20:_Q%!0=b%:
UC%=-1
UC%=_Q%!28
&400C5,,_Q%:
&400CB,,_Q%:
&400C6,,_Q%
shell_HeapBlockFetch(&400):e%=0:
eB%!e%<>-1:t%!0=eB%!e%:
jE%=0
jE%=t%!0
+XE%=t%!0:
&400CB,,t%:CC%=jD%!e%:
0,1:QA%=t%!16-t%!8:mA%=t%!&C-t%!4:t%!4=_Q%!4+QB%!e%:t%!&C=t%!4+mA%:t%!16=_Q%!16+fB%!e%:t%!8=t%!16-QA%
2:QA%=t%!16-t%!8:mA%=_Q%!&C-_Q%!4:t%!4=_Q%!4+QB%!e%:t%!&C=_Q%!&C:t%!16=_Q%!16+fB%!e%:t%!8=t%!16-QA%
3:QA%=_Q%!16-_Q%!8:mA%=t%!&C-t%!4:t%!4=_Q%!4+QB%!e%:t%!&C=t%!4+mA%:t%!16=_Q%!16:t%!8=_Q%!8+fB%!e%
4:QA%=t%!16-t%!8:mA%=_Q%!&C-_Q%!4:t%!4=_Q%!4+QB%!e%:t%!&C=_Q%!&C:t%!16=_Q%!8+QA%+fB%!e%:t%!8=t%!16+QA%
5:QA%=_Q%!16-_Q%!8:mA%=t%!&C-t%!4:t%!4=_Q%!&C-mA%+QB%!e%:t%!&C=t%!4+mA%:t%!16=_Q%!16:t%!8=_Q%!8
t%!28=UC%
t%!28=kE%
&400C5,,t%:kE%=t%!0:e%+=4:
_Q%!28=XE%:
&400C5,,_Q%
shell_HeapBlockReturn(t%)
_Q%!0=b%:
&400CB,,_Q%
UC%=-2
_Q%!28=-2
xD%=-1
_Q%!28=-1
&400C5,,_Q%
shell_CloseWindow(b%):
d%,a%,eB%,jD%,QB%,fB%,p%,EC%:d%=
shell_GetEventListOffset(b%,-1,_U%+308,&C,
d%>=0
ha%=_U%!308+d%:c%=a%!8:
shell_Tracef0("CloseWindow:About to call "+"FN"+$c%):EC%=
("FN"+$c%):
EC%=0
shell_HeapBlockFetch(60):
shell_GetEventListOffset(b%,-1,_U%+92,24,
d%>-1
la%=(_U%!92)+d%:jD%=a%!&C:QB%=a%!16:fB%=a%!20:e%=0:eB%=a%!8:
eB%!e%<>-1:p%!0=eB%!e%:
&400C6,,p%:e%+=4:
:p%!0=b%:
&400C6,,p%
shell_HeapBlockReturn(p%):
shell_DeleteWindow(h%):
p%:p%=
shell_HeapBlockFetch(20):
h%<>0
oktodeletew(h%)
shell_EventDeleteAll(h%):
h%=_U%!20
_U%!20=0
..d%=
shell_SearchStatic(_U%!&B8,h%):
d%>-1
c%=_U%!&B8+d%:c%!0=0
:p%!0=h%:
&400C3,,p%:h%=0
shell_HeapBlockReturn(p%):=h%
oktodeletew(h%):=-1
oktoclosew(h%):=-1
cliprect(A,
wE%):
GA%,KA%:
lwaorigin(A,GA%,KA%):RA%=A!24-GA%:ZA%=A!28-KA%:HF%=A!32-GA%:wE%=A!36-KA%:
poll(rB%,TE%):
_U%!&64
"WimpExt_PrePoll"
&400C7,rB%,_Q%
_U%!&64
"WimpExt_Action",_U%!&94,_Q%,DA%
shell_Poll_I(rB%,TE%):
_U%!&64
"WimpExt_PrePoll"
&400C7,rB%,_Q%
_U%!&64
"WimpExt_Action",_U%!&94,_Q%,DA%
"Interface_Poll",DA%,,TE%:=DA%
shell_DoBackgroundTask:
shell_IconIsDraggable(b%,g%):
i%:i%=
shell_IconGetFlags(b%,g%):c%=(i%
&6000):
c%=&6000=
shell_IconIsSprite(b%,g%):
i%,c%:i%=
shell_IconGetFlags(b%,g%):c%=(i%
1<<1):
c%=(1<<1)
shell_IconDragBox(b%,g%):
a%,H,J,cD%,i%,JA%,oD%,CE%,hB%,u$:
QC%,Q$:cD%=
shell_GetEventListOffset(b%,g%,_U%+72,24,
cD%>=0
na%=_U%!72+cD%:QC%=a%!16:Q$=
shell_IconGetData(b%,QC%):
Q$=""
shell_OK(
shell_MessageNoArgs("SHELLMSG28"))
shell_HeapBlockFetch(&64+(
shell_WindowCountIcons(b%)*32)):!a%=b%:
&400CC,,a%:H=a%!4-a%!20:J=a%!16-a%!24:CE%=a%!68:a%!4=g%:
&400CE,,a%:!a%=b%:a%!4=5:i%=a%!24:hB%=a%!32:a%!8=a%!8+H:a%!&C=a%!&C+J:a%!16=a%!16+H:a%!20=a%!20+J:a%!24=0:a%!28=0
Ja%!32=&7FFFFFFF:a%!36=&7FFFFFFF:
6,&A1,28
,,JA%:oD%=((JA%
2)=2):
JA%=i%:
shell_IconGetCommand(hB%,"s")
shell_OK(
shell_MessageNoArgs("SHELLMSG19"))
u$<>""
&42400,&85,CE%,u$,a%+8:_U%!&64=_U%!&64
&400D0,,a%
&400D0,,a%
shell_HeapBlockReturn(a%)
shell_Tracef0("IconDragBox:WARNING! no drag handler registered for this icon!")
shell_HandleAttachedMenu(_Q%,b%,g%):
g%<>-1
b%>-1
shell_GetEventMenu(_Q%!8,b%,g%):
k%<>0
shell_HandleMenuOpen(_Q%,k%,b%,g%,
shell_Action(UF%):
A$,k%,a$,kA$,EB%,oA%,yA%,JD%:
b%,g%,o%,_temp28%,_temp32%,_temp24%,_temp%,LD%:
tB%,d%:
shell_DoBackgroundTask
shell_RedrawWindow(_Q%!0)
shell_OpenWindow(_Q%!0,
shell_CloseWindow(_Q%!0)
shell_PointerLeavingWindow(_Q%)
shell_PointerEnteringWindow(_Q%)
6:_U%!28=_Q%!&C:_U%!32=_Q%!16:oA%=_Q%!0:yA%=_Q%!4:_U%!272=_Q%!0:_U%!276=_Q%!4:_U%!320=_Q%!8:_temp28%=_Q%!&C:_temp32%=_Q%!16:g%=_Q%!16:
shell_Tracef0("Action:Mouse_Click event detected")
shell_Tracef0("Action:Window Handle was &"+
~_Q%!&C+" Icon Handle was "+
_Q%!16):
_Q%!&C=_U%!288
_Q%!16=_U%!292
shell_HandleBumpIcons(_U%!296,_Q%!&C,_Q%!16,_Q%!8)
_U%!288=-1:_U%!292=-1:_U%!296=-1:
_Q%!16>=0
shell_GetEventListOffset(_Q%!&C,_Q%!16,_U%+&68,16,0):
d%>=0
shell_HandleBumpIcons(d%,_Q%!&C,_Q%!16,_Q%!8)
(_Q%!8=64)
3BA%=
shell_IconIsDraggable(_Q%!&C,_Q%!16):
<V$="Icon is draggable":
shell_IconDragBox(_Q%!&C,_Q%!16)
V$="Icon is not draggable"
shell_Tracef0("Action:"+V$)
_Q%!8
shell_ActionSelectButton
shell_ActionMenuButton
shell_ActionAdjustButton
_U%!&64
&42401:_U%!&64=_U%!&64
:_U%!&80=0:A$=
shell_GetEventHandler(_U%!28,_U%!32,6):
A$<>""
shell_Tracef0("Action:Drag event detected - function is "+A$):o%=
("FN"+A$+"(_temp28%,_temp32%)")
shell_Tracef0("Action:Drag event detected - no handler function"):
shell_SendDataSave(_U%!28,_U%!32)
shell_Tracef0("Action:keypress is="+
_Q%!24):
_Q%!24
&D,394,398,399,410,430,431:JD%=
shell_WritableIconHandler(_Q%!0,_Q%!4,_Q%!24)
shell_HotKeyProcess(_Q%!24)
shell_Tracef0("Action:Keypress not claimed, passing it on"):
&400DC,_Q%!24
shell_Tracef0("Action:Keypress claimed by this application")
shell_ActionMenuSelect(_Q%)
17,18:
shell_Receive(_Q%)
shell_UserMessageAcknowledge(_Q%)
shell_ActionSelectButton:
shell_Tracef0("ActionSelectButton:Mouse Button was SELECT"):
shell_HandleAttachedMenu(_Q%,_U%!28,_U%!32):A$=
shell_GetEventHandler(_U%!28,_U%!32,2):
_U%!32=0
shell_DataSaveCheckName(_U%!28,_U%!32)
A$<>""
shell_IconSlab(4,_U%!28,_U%!32):
shell_Tracef0("ActionSelectButton:About to call "+"FN"+A$+"("+
_temp28%+","+
_temp32%+")"):o%=
("FN"+A$+"(_temp28%,_temp32%)")
_U%!32=0
_U%!28=_U%!20
&400D4,,-1
shell_ActionMenuButton:
c%,k%,uB%:uB%=
shell_Tracef0("ActionMenuButton:Mouse Button was MENU"):c%=
shiftmenuclick(_Q%!&C,_Q%!16)
shell_Tracef0("ActionMenuButton:Checking menu events.."):
shell_Tracef0("ActionMenuButton:button="+
_Q%!8+" _Q%!12="+
_Q%!&C+" _Q%!16="+
_Q%!16):k%=
shell_GetEventMenu(_Q%!8,_Q%!&C,_Q%!16):
(k%<>0
_Q%!&C>0
_Q%!16>=0)
K+k%=
shell_GetEventMenu(_Q%!8,_Q%!&C,-1)
shell_Tracef0("ActionMenuButton:Menu handle is:&"+
~k%):
k%<>0
shell_HandleMenuOpen(_Q%,k%,_Q%!&C,_Q%!16,uB%)
shell_HandleMenuOpen(_Q%,k%,b%,g%,uB%):
n%,s%:
shell_OpenMenu(_Q%!0,_Q%!4,k%)
shell_HeapBlockFetch(50):s%=
shell_HeapBlockFetch(36):n%!0=b%:n%!4=g%:
&400CE,,n%:s%!0=b%:
&400CB,,s%:
shell_OpenMenu(s%!4+n%!16+64,_Q%!4,k%):
s%!4+n%!16+64,_Q%!4:
shell_HeapBlockReturn(n%):
shell_HeapBlockReturn(s%)
shell_ActionMenuSelect(_Q%):
TD%,EB%,tB%,LD%,o%,lC%:lC%=
shell_HeapBlockFetch(256):
shell_Tracef0("ActionMenuSelect:Menu_Select event detected"):
&400CF,,_shell_blk%:EB%=
shell_HeapBlockFetch(256):
_U%!24=_U%!&FC
tB%=0:_U%!264=1
shell_CheckSelection(_Q%):
tB%>-1
_U%!264=1
_U%!264=0
_U%!264>0
"FontMenu_DecodeFontMenu",_Q%+tB%,EB%
LD%=1
shell_Tracef0("ActionMenuSelect:FontMenu selection ("+
shell_GetString(EB%)+")"):
shell_FontMenuSelectFont(
shell_GetString(EB%),_U%!260):
_shell_FontMenuSelFN$=""
&400D5,,_U%!24,_Q%,EB%:A$=
shell_GetEventHandler(_U%!52,_U%!56,0):_temp%=EB%:$_temp%=
shell_StringStripTrailing($_temp%," "):
A$<>""
("FN"+A$+"($_temp%)")
_shell_FontMenuSelFN$<>""
("FN"+_shell_FontMenuSelFN$+"(FNshell_FontMenuGetLastSelectedFont)")
shell_HeapBlockReturn(EB%):
_U%!264=0
&45BC4,_U%!24,_Q%
TD%,,lC%:
shell_MenuCallHandler(TD%,lC%)
_shell_blk%!8=1
shell_HeapBlockExists(_U%!&E0)
_temp%=_U%!&E0:
$_temp%<>""
("FN"+$_temp%+"(_U%!52,_U%!56)")
shell_OpenMenu(_U%!36,_U%!40,_U%!24)
_shell_FontMenuSelFN$=""
shell_HeapBlockReturn(lC%):
shell_ActionAdjustButton:
i%,A$,o%,vB%,e%:vB%=
shell_HeapBlockFetch(&C+(
shell_WindowCountIcons(_U%!28)*32)):
shell_Tracef0("Action:Mouse Button was ADJUST"):
_U%!28>0
&400D6,_U%!28,vB%,&F000,&B000:e%=0:
vB%!e%<>-1:
vB%!e%=_U%!32
shell_IconSet(_U%!28,_U%!32,1)
e%+=4:
shell_GetEventHandler(_U%!28,_U%!32,3):
A$<>""
shell_IconSlab(1,_U%!28,_U%!32):o%=
("FN"+A$+"(_temp28%,_temp32%)")
shell_HeapBlockReturn(vB%):
shiftmenuclick(b%,g%):=
shell_IconSlab(pC%,b%,g%):
a%:a%=
shell_HeapBlockFetch(50):a%!8=pC%:a%!&C=b%:a%!16=g%:
"Interface_SlabButton",,a%:a%!8=0:
"Interface_SlabButton",,a%:
shell_HeapBlockReturn(a%):
shell_PointerLeavingWindow(_Q%):
n%,o%:n%=
shell_HeapBlockFetch(&C):
&400D6,!_Q%,n%,&3F0000,&F<<16:
!n%<>-1
("FN"+
shell_IconGetData(!_Q%,!n%))
shell_HeapBlockReturn(n%):
shell_PointerEnteringWindow(_Q%):
n%,o%,b%:b%=_Q%!0:n%=
shell_HeapBlockFetch(&C):
&400D6,b%,n%,&3F0000,&E<<16:
!n%<>-1
("FN"+
shell_IconGetData(b%,!n%))
shell_HeapBlockReturn(n%):
shell_RedrawWindow(h%):
OC%,A$,GA%,KA%,a%,n%:n%=
shell_HeapBlockFetch(&C):
&400D6,h%,n%,&3F0000,&D<<16:
!n%<>-1
!A$=
shell_IconGetData(h%,!n%)
shell_HeapBlockReturn(n%):a%=
shell_HeapBlockFetch(&64):
A$=""
shell_GetEventHandler(h%,-1,4)
:a%!0=h%:
&400C8,,a%
OC%:GA%=a%!4-a%!20:KA%=a%!16-a%!24:
"Interface_Render3dWindow",,a%:
A$<>""
("FN"+A$+"("+
a%+","+
GA%+","+
KA%+")")
&400CA,,a%
shell_HeapBlockReturn(a%):
shell_Receive(_Q%):
c%,o%:
_Q%!16
shell_Exit:
shell_DataSave(_Q%)
shell_DataSaveAck(_Q%)
shell_DataLoad(_Q%,
shell_DataLoadAck(_Q%)
shell_DataLoad(_Q%,
shell_RAMFetch(_Q%)
shell_RAMTransmit(_Q%)
shell_Message_PreQuit(_Q%)
_U%!&A4>0
shell_Tracef0("Receive:PaletteChange message received"):c%=_U%!&A4:o%=
("FN"+$c%)
shell_Message_SaveDesktop(_Q%)
shell_Message_Shutdown(_Q%)
&502:
shell_InteractiveHelp(_Q%)
&400C0:
shell_MenuWarning(_Q%)
&400C1:
shell_Message_ModeChange(_Q%)
&400C2:
_U%!&A8>0
shell_Tracef0("Receive:TaskInitialise message received"):c%=_U%!&A8:o%=
("FN"+$c%+"("+
(_Q%!4)+","+
shell_GetString(_Q%+28)+
34+")")
_U%!&D0=-1
shell_GetString(_Q%+28)="StrongHelp"
_U%!&D0=_Q%!4:
shell_StrongHlpMsg("Help_Install -DieWithTask "+
shell_GetAppDir+"."+
shell_GetAppName):c%=_U%!&D8:
$c%<>""
shell_HelpWord($c%):
shell_HeapBlockReturn(_U%!&D8):_U%!&D8=0
&400C3:
_U%!&AC>0
shell_Tracef0("Receive:TaskCloseDown message received"):c%=_U%!&AC:o%=
("FN"+$c%)
_Q%!4=_U%!&D0
_U%!&D0=-1
&400C7:
shell_Tracef0("Receive:TaskNameIs message received"):
shell_GetString(_Q%+28)="StrongHelp"
_U%!&D0=_Q%!20
shell_ScanForHelp
shell_HandleUnknownMessage2(_Q%)
shell_Message_ModeChange(_Q%):
d%,e%,RB%,s%:RB%=_U%!&B8:
_U%!&A0>0
shell_Tracef0("Message_ModeChange:ModeChange message received"):c%=_U%!&A0:o%=
("FN"+$c%)
shell_HeapBlockFetch(&64):
RB%<>0
shell_Tracef0("Message_ModeChange:Checking static window list for pane events"):
RB%!e%<>-1:d%=
shell_GetEventListOffset(RB%!e%,-1,_U%+92,24,
d%>-1
shell_Tracef0("Message_ModeChange:Static window handle found"):
shell_WindowIsOpen(RB%!e%)
shell_Tracef0("Message_ModeChange:Window is open.."):!s%=RB%!e%:
&400C6,,s%:
shell_OpenWindow(RB%!e%,0,-1)
:e%+=4:
shell_HeapBlockReturn(s%):
shell_Message_Shutdown(_Q%):
_U%!312>0
shell_Tracef0("Message_Shutdown:Shutdown message received"):c%=_U%!312:o%=
("FN"+$c%)
shell_HandleUnknownMessage2(_Q%):
_Q%!16
&43B00:W$=$(_Q%+20):
W$,30)="EvntShellLib:ShellDBug started"
_U%!&64
r_U%!&64=(_U%!&64
1<<4):
shell_BroadcastMessage(&43B00,"ShellDBug:Init Debug messages from "+
shell_GetAppName)
W$,25)="EvntShellLib:TraceInitAck"
_U%!&64=(_U%!&64
1<<4)
W$,20)="EvntShellLib:TraceOn"
shell_TraceOn
W$,21)="EvntShellLib:TraceOff"
shell_TraceOff
W$,28)="EvntShellLib:ListClickSelect"
shell_ListClickSelect
W$,28)="EvntShellLib:ListClickAdjust"
shell_ListClickAdjust
W$,25)="EvntShellLib:ListHelpTags"
shell_ListHelpTags
shell_HandleUnknownMessage(_Q%):
shell_HandleUnknownMessage(_Q%):
shell_AttachPreQuitHandler(A$):
c%,o%:
_U%!300>0
shell_HeapBlockReturn(_U%!300)
<_U%!300=
shell_HeapBlockFetch(
A$+1):c%=_U%!300:$c%=A$:
shell_AttachShutdownHandler(A$):
c%,o%:
_U%!312>0
shell_HeapBlockReturn(_U%!312)
<_U%!312=
shell_HeapBlockFetch(
A$+1):c%=_U%!312:$c%=A$:
shell_AttachModeChangeHandler(A$):
c%,o%:
_U%!&A0>0
shell_HeapBlockReturn(_U%!&A0)
J_U%!&A0=
shell_HeapBlockFetch(
A$+1):c%=_U%!&A0:$c%=A$:o%=
("FN"+A$):
shell_AttachPaletteChangeHandler(A$):
c%,o%:
_U%!&A4>0
shell_HeapBlockReturn(_U%!&A4)
J_U%!&A4=
shell_HeapBlockFetch(
A$+1):c%=_U%!&A4:$c%=A$:o%=
("FN"+A$):
shell_AttachTaskInitialiseHandler(A$):
c%,o%:
_U%!&A8>0
shell_HeapBlockReturn(_U%!&A8)
<_U%!&A8=
shell_HeapBlockFetch(
A$+1):c%=_U%!&A8:$c%=A$:
shell_AttachTaskCloseDownHandler(A$):
c%,o%:
_U%!&AC>0
shell_HeapBlockReturn(_U%!&AC)
<_U%!&AC=
shell_HeapBlockFetch(
A$+1):c%=_U%!&AC:$c%=A$:
shell_RAMFetch(_Q%):
fF%,lD%,xC%:xC%=
_U%!&90>&8000
shell_Tracef0("RAMFetch:RAMFetch called.."):_Q%!&C=_Q%!8:_Q%!16=7:lD%=_U%!&88:
_U%!&8C=&FF9
_U%!&90+=4
(lD%-_U%!&80)<_Q%!24
_Q%!24=lD%-_U%!&80:xC%=
shell_Tracef0("RAMFetch:Sending block")
&400F1,_U%!&94,_U%!&90+_U%!&80,_Q%!4,_Q%!20,_Q%!24:
&400E7,17,_Q%,_Q%!4:_U%!&78=_Q%!8:_U%!&80+=_Q%!24:
_U%!&80=0
shell_RAMTransmit(_Q%):
d%,a%,RA$,c%:
_Q%!&C=_U%!&70
5$_U%!&80+=_Q%!24:
_Q%!24<_U%!&84
shell_Tracef0("RAMTransmit:Last block received"):d%=
shell_GetEventListOffset(_U%!28,_U%!32,_U%+96,16,
):a%=_U%!96+d%:
shell_Tracef0("RAMTransmit:_U%!28="+
_U%!28):
shell_Tracef0("RAMTransmit:_U%!32="+
_U%!32)
shell_Tracef0("RAMTransmit:offset%="+
d%):c%=_U%!&9C:RA$=
shell_GetString(c%+44):
shell_UserFNLoadFile(c%!40,_U%!&98,a%!8,RA$,_U%!&84,a%)
shell_Tracef0("RAMTransmit:Block received"):
_U%!&80>_U%!&84
shell_Tracef0("RAMTransmit:Increasing buffer size.."):_U%!&98=
shell_HeapBlockExtend(_U%!&98,_U%!&80,_U%!&84)
:_Q%!&C=_Q%!8:_Q%!16=6:_Q%!20=_U%!&98+_U%!&80:_Q%!24=_U%!&84:
&400E7,18,_Q%,_Q%!4:_U%!&70=_Q%!8
shell_HeapBlockReturn(_U%!&98):_U%!&98=0:
shell_OK(
shell_MessageNoArgs("SHELLMSG15"))
shell_LoadFile(dF%):
p$,MB%,MC%,zA%:p$=
shell_GetString(_Q%+44):MB%=
shell_FileLength(p$):
MB%<0
shell_OK(
shell_MessageNoArgs("SHELLMSG16"))
jPzA%=
shell_HeapBlockFetch(MB%):
&20008,16,p$,zA%,0
;MC%:
shell_VFlag(MC%)
shell_HeapBlockReturn(zA%):
shell_OK(
shell_MessageNoArgs("SHELLMSG17"))
shell_Tracef0("LoadFile:File "+p$+" loaded ok at &"+
~zA%)
:=zA%
shell_VFlag(MC%):=((MC%
1)=1)
shell_CheckType(u%,SB%,TB%):
qF%,e%,m%,c%,PC%:e%=0:m%=-1:PC%=
_U%!&64
_U%!&64=_U%!&64
SB%!e%<>-1:c%=SB%!e%:
1<<31
c%=c%
1<<31:PC%=
c%=u%
m%=e%:
L_U%!&64=_U%!&64
1<<1:
shell_Tracef0("CheckType:Top Bit Load detected..")
:e%+=4:
(u%>=4096)
m%=-1
m%>-1
shell_Tracef0("CheckType:File type OK "+
~SB%!m%)
shell_Tracef0("CheckType:File type NOT ok "+
m%<>-1
shell_Exit:
YB%:YB%=_U%!68:
&61504,YB%:
&2001E,7,,YB%:
shell_Tracef0("Exit:Application closing down"):
shell_TraceExit:
&606C2:
&600D0,,-1:
shell_WimpCloseDown_I(_U%!&94):
shell_DataLoad(_Q%,TB%):
gF%,d%,a%,_temp%,SB%,u%,e$:
shell_DataOpenOKToLoad(TB%,_Q%!40)
du%=_Q%!40:e$=
shell_GetString(_Q%+44):
shell_Tracef0("DataLoad:DataLoad message received"):
_U%!96<>0
d%=-1
shell_GetEventListOffset(_Q%!20,_Q%!24,_U%+96,16,
d%=-1
shell_GetEventListOffset(_Q%!20,-1,_U%+96,16,
d%>-1
4a%=_U%!96+d%:
shell_CheckType(_Q%!40,a%!8,TB%)
shell_Tracef0("DataLoad:File type recognised (&"+
~_Q%!40+")"):LF%=_Q%!&C:_Q%!&C=_Q%!8:_Q%!16=4:
&400E7,18,_Q%,_Q%!4:
_U%!&64
zA%=-1:_U%!&64=_U%!&64
shell_LoadFile(LF%=_U%!&6C)
shell_UserFNLoadFile(u%,zA%,a%!8,e$,_Q%!36,a%):
_U%!&9C<>0
shell_HeapBlockReturn(_U%!&9C):_U%!&9C=0
shell_Tracef0("DataLoad:File type NOT recognised (&"+
~_Q%!40+")")
shell_DataOpenOKToLoad(TB%,u%):
BA%,AD%,s$,FA$:
ZBA%=
shell_Tracef0("DataOpenOKToLoad:Message reason code was 3, normal drag load..")
shell_Tracef0("DataOpenOKToLoad:Message reason code was 5, double click load.."):AD%=
shell_HeapBlockFetch(256):s$=
shell_OSVarGetVal(AD%,256,"Alias$@RunType_"+
~u%,1):
shell_Tracef0("DataOpenOKToLoad:Alias$@RunType="+s$):
shell_HeapBlockReturn(AD%)
zFA$=
shell_Branch(s$):
shell_Tracef0("DataOpenOKToLoad:dbug "+FA$):
shell_Leaf(FA$)="!"+
shell_GetAppName
:=BA%
shell_UserFNLoadFile(u%,zA%,SB%,_filename$,_file_size%,a%):
e%,m%,c%,o%:e%=0:m%=-1:
SB%!e%<>-1:c%=SB%!e%:
1<<31
c%=c%
1<<31
c%=u%
m%=e%
&[e%+=4:
:c%=a%!&C:o%=
("FN"+$(c%!m%)+"("+
zA%+","+
u%+",_filename$,"+
_file_size%+")"):
shell_DataSave(_Q%):
c%,d%,a%,r%:
shell_Tracef0("DataSave:DataSave message received"):
_Q%!4<>_U%!&94
:Cd%=
shell_GetEventListOffset(_Q%!20,_Q%!24,_U%+96,16,
d%>-1
<2a%=_U%!96+d%:
shell_CheckType(_Q%!40,a%!8,
shell_Tracef0("DataSave:Filetype recognized (&"+
~_Q%!40+")"):
shell_TopBitLoadInProgress
shell_Tracef0("DataSave:'no load' flag set"):
shell_Tracef0("DataSave:Sending Message_DataSaveAck"):_Q%!0=256:_Q%!&C=_Q%!8:_Q%!36=-1:_Q%!16=2:$(_Q%+44)=
shell_GetAppDir+".ScrapFile"+
&400E7,18,_Q%,_Q%!4
shell_HeapBlockReturn(_U%!&9C):_U%!&9C=
shell_HeapBlockFetch((_Q%!0)+8):c%=_U%!&9C:
_Q%!0
4:c%!r%=_Q%!r%:
r%:_U%!28=_Q%!20:_U%!32=_Q%!24:_U%!&80=0:_U%!&84=_Q%!36:_U%!&98=
shell_HeapBlockFetch(_Q%!36):_Q%!0=28:_Q%!&C=_Q%!8:_Q%!16=6
_Q%!20=_U%!&98+_U%!&80:_Q%!24=_U%!&84:
&400E7,18,_Q%,_Q%!4:_U%!&70=_Q%!8:
shell_Tracef0("DataSave:Sending Message_RAMFetch")
shell_Tracef0("DataSave:Filetype NOT recognized")
shell_TopBitLoadInProgress:
_U%!&64
shell_SendDataSave(b%,g%):
a%,VA%,UB%,d%,MB%,o%:UB%=
shell_HeapBlockFetch(30):
&400CF,,UB%:d%=
shell_GetEventListOffset(b%,g%,_U%+72,24,
d%=-1
d%=-2
shell_MessageWindow(
shell_MessageNoArgs("SHELLMSG13"),0,"",
shell_MessageNoArgs("warning"))
a%=(_U%!72)+d%:
a%!8>&8000
$MB%=
shell_HeapBlockInfo(a%!8)-4
MB%=a%!8
:VA%=_U%!76:VA%!0=256:VA%!&C=0:VA%!16=1:VA%!20=UB%!&C:VA%!24=UB%!16:VA%!28=UB%!0:VA%!32=UB%!4:VA%!36=MB%:VA%!40=a%!&C:$(VA%+44)=
shell_Leaf(
shell_IconGetData(b%,a%!16)):
&400E7,18,VA%,VA%!20,VA%!24:_U%!&78=_Q%!8:_U%!&88=MB%:_U%!&8C=a%!&C
;_U%!&90=a%!8:_U%!&9C=a%!4:_U%!&C8=VA%!20:_U%!&CC=VA%!24
shell_HeapBlockReturn(UB%):
shell_DataSaveAck(_Q%):
_fullname$,DA%,eA%,a%,c%,o%:
shell_Tracef0("DataSaveAck:DataSaveAck message received"):DA%=0:eA%=_Q%?(44+DA%):
eA%<>0:_fullname$+=
(eA%):DA%+=1:eA%=_Q%?(44+DA%):
shell_Tracef0("DataSaveAck:Full save name is: "+_fullname$)
shell_Tracef0("DataSaveAck:task="+
_Q%!4):
shell_Tracef0("DataSaveAck:mytask="+
_U%!&94):d%=
shell_GetEventListOffset(_U%!28,_U%!32,_U%+72,24,
d%=-1
d%=-2
shell_MessageNoArgs("SHELLMSG05")
%a%=(_U%!72)+d%:c%=a%!20:
$c%<>""
("FN"+$c%+"(_fullname$)")
shell_HeapBlockExists(a%!8)
8,&A,_fullname$,a%!&C,,a%!8,a%!8+
shell_HeapBlockInfo(a%!8)+1
shell_MessageNoArgs("SHELLMSG21")
_Q%!36>-1
_U%!80<>0
shell_HeapBlockReturn(_U%!80)
H_U%!80=
shell_HeapBlockFetch(
_fullname$+1):c%=_U%!80:$c%=_fullname$
:_Q%!16=3:!_Q%=256:_Q%!20=_U%!&C8:_Q%!24=_U%!&CC:_Q%!40=_U%!&8C:_Q%!36=
shell_FileLength(_fullname$):_Q%!&C=_Q%!8:
shell_Tracef0("DataSaveAck:File length is "+
_Q%!36+" bytes"):$(_Q%+44)=_fullname$+
(0):_U%!84=_Q%!8
shell_Tracef0("DataSaveAck:Sending DataLoad Message"):
&400E7,18,_Q%,_Q%!20,_Q%!24:
_U%!28<>_U%!20
shell_CloseWindow(_U%!28)
&400D4,,-1:
shell_DataSaveCheckName(b%,g%):
d%,a%,q%:a%=_U%!72:d%=0:
a%<>0
shell_HeapBlockInfo(a%)-8:
!(a%+d%)=b%
shell_IconGetData(!a%,a%!16):
Q$,".")=0
shell_OK(
shell_MessageNoArgs("SHELLMSG01"))
d%=q%
:d%+=24:
d%>=q%
shell_DataLoadAck(_Q%):
shell_Tracef0("DataLoadAck:DataLoadAck message received (file received ok)"):
shell_UserMessageAcknowledge(_Q%):
_Q%!16
shell_AckDataLoad(_Q%)
shell_AckRAMFetch(_Q%)
shell_AckDataLoad(_Q%):
_Q%!&C<>_U%!84
&20008,6,"<Wimp$Scrap>":
&FF,"Data Transfer failed: Receiver died"
shell_AckRAMFetch(_Q%):
vD%,c%:c%=_U%!&9C:
shell_Tracef0("AckRAMFetch:AckRAMFetch called...."):
_Q%!&C<>_U%!&70
_U%!&80=0
shell_Tracef0("AckRAMFetch:Receiver does not support RAM transfer"):
&20023,"Wimp$Scrap",,-1,0,3
,,vD%:
vD%<>0
$(c%+44)="<Wimp$Scrap>"+
(0):c%!0=(49+
shell_GetString(c%+44)))
3:c%!&C=c%!8:c%!16=2:c%!36=-1:
&400E7,18,c%,c%!4:_U%!&6C=c%!8
shell_OK(
shell_MessageNoArgs("SHELLMSG14"))
shell_Tracef0("AckRAMFetch:RAM transfer started, but not enough data sent. Sender died?"):
shell_HeapBlockReturn(_U%!&98):_U%!&98=0:
shell_OK("SHELLMSG06")
shell_MenuWarning(_Q%):
A$,EB%,OA%,PA%,o%,_temp%,DA%,C$,VB%,a%:OA%=_Q%!24:PA%=_Q%!28:_U%!264=0:
_U%!20<>0
shell_Tracef0("MenuWarning:Removing last dynamic dbox (handle=&"+
~_U%!20+")"):o%=
shell_DeleteWindow(_U%!20):
shell_Tracef0("MenuWarning:Last dynamic dbox removed")
_Q%!20
_U%!&E4:
shell_WindowRetitle(_U%!&E4,
shell_MessageNoArgs("warning")):
shell_IconPutData(_U%!&E4,1,
shell_MessageNoArgs("SHELLMSG07"),0):
&400E8,,_U%!&E4,OA%,PA%
shell_MenuGetItemAddress(_U%!24,_Q%+32):
shell_HeapBlockExists(VB%!4)
shell_MenuWarnDBox(VB%,OA%,PA%)
shell_HeapBlockFetch(32):
&45BC4,_U%!24,_Q%+32
,,a%:
shell_FindMenuWarnEvent(a%!8,C$,J$):
shell_HeapBlockReturn(a%):
shell_MenuWarnSubMenu(_Q%!20,OA%,PA%,C$,J$)
shell_MenuWarnDBox(nA%,OA%,PA%):
c%,y%,o%:
c%=nA%!4:
shell_CreateWindow($c%!0,y%):
shell_Tracef0("MenuWarnDBox:Creating new dynamic dbox (handle=&"+
~y%+")"):
$c%!4<>""
shell_Tracef0("MenuWarnDBox:Calling preopen FN '"+$c%!4+"'"):o%=
("FN"+$c%!4+"("+
y%+")")
$c%!8<>""
shell_Tracef0("MenuWarnDBox:Calling postopen FN '"+$c%!8+"'"):o%=
("FN"+$c%!8+"("+
y%+")")
&400E8,,y%,OA%,PA%:_U%!20=y%:
shell_FindMenuWarnEvent(fA%,
BA%,v%,c%,d%,m%,q%,_%,e%:
XB%:XB%=0:v%=_U%!&DC:d%=0:m%=
:C$="":XB%=0:
shell_HeapBlockExists(v%)
:e%+=4:
v%!e%=-1:q%=e%:e%=0:
shell_Tracef0("FindMenuWarnEvent:list_size%="+
:c%=!(v%+d%+0):
c%<>-1
c%=fA%
:_%=v%!(d%+4):C$=$_%:XB%=v%!(d%+8):_%=v%!(d%+&C):J$=$_%:
shell_Tracef0("FindMenuWarnEvent:submenu found")
:d%+=16
d%=q%
d%>=q%
C$="":J$=""
XB%=0
shell_Tracef0("FindMenuWarnEvent:warn fn not found..")
shell_MenuWarnSubMenu(MD%,OA%,PA%,C$,J$):
o%,c%,_A%,e%:_shell_FontMenuSelFN$=J$:
shell_HeapBlockExists(_U%!&E0)
shell_HeapBlockReturn(_U%!&E0)
C_U%!&E0=
shell_HeapBlockFetch(
C$+1):c%=_U%!&E0:$c%=C$:
C$<>""
("FN"+C$+"(_U%!52,_U%!56)"):
shell_Tracef0("MenuWarnSubMenu:Calling FN"+C$)
MD%=_U%!&FC
shell_Tracef0("MenuWarnSubMenu:FontMenu opening.."):
shell_HeapBlockExists(_U%!256)
shell_HeapBlockReturn(_U%!256)
e%=0:
:e%+=4:
!(_Q%+32+e%)=-1:e%+=4:_U%!256=
shell_HeapBlockFetch(e%):c%=_U%!256:e%=0:
:c%!e%=!(_Q%+32+e%):e%+=4:
!(_Q%+32+e%)=-1:c%!e%=!(_Q%+32+e%):c%=_U%!256
shell_Tracef0("MenuWarnSubMenu:Selecting '"+
shell_FontMenuGetLastSelectedFont+"' in FontMenu.."):
"FontMenu_Select",
shell_FontMenuGetLastSelectedFont,_U%!260
,_A%:_U%!264=1:
_A%<>_U%!&FC
shell_FontMenuUpdatePtr(_A%):_U%!&FC=_A%:MD%=_A%
_U%!264=0
&400E8,,MD%,OA%,PA%:
shell_AttachSubMenu(CB%,XB%,C$):
&45BCE,CB%,XB%:
C$<>""
&45BCC,,
shell_EventListMenuWarn(CB%,XB%,C$,"")
shell_EventListMenuWarn(CB%,KE%,C$,J$):
c%,_%,e%,v%:
_U%!&DC=0
_U%!&DC=
shell_HeapBlockFetch(32):c%=_U%!&DC:c%!0=CB%:c%!4=
shell_HeapBlockFetch(
C$+1):$(c%!4)=C$:c%!8=KE%:c%!&C=
shell_HeapBlockFetch(
J$+1):$(c%!&C)=J$:c%!16=-1:c%!20=-1:c%!24=-1:c%!28=-1
shell_HeapBlockExtend(_U%!&DC,32):_U%!&DC=v%:e%=0:
:e%+=16:
v%!e%=-1:c%=_U%!&DC:c%!e%=CB%:c%!(e%+4)=
shell_HeapBlockFetch(
C$+1):_%=c%!(e%+4):$(_%)=C$:c%!(e%+8)=KE%:c%!(e%+&C)=
shell_HeapBlockFetch(
J$+1):_%=c%!(e%+&C):$(_%)=J$
;c%!(e%+16)=-1:c%!(e%+20)=-1:c%!(e%+24)=-1:c%!(e%+28)=-1
shell_InteractiveHelp(_Q%):
I$,V$,K$,GB%,VD%,iA$,n%:n%=
shell_HeapBlockFetch(&C):
&400D6,_Q%!32,n%,&3F0000,&C<<16:
!n%<>-1
(%I$=
shell_IconGetData(_Q%!32,!n%)
shell_HeapBlockReturn(n%):
I$=""
shell_GetEventHandler(_Q%!32,_Q%!36,8)
-7K$=
shell_IconGetValidation(_Q%!32,_Q%!36):
K$<>""
shell_StringUpperCase(
K$,1))="I"
K$,";"):
GB%=0
K$,2)
K$,2,GB%-2)
shell_StringUpperCase(K$),
shell_StringUpperCase(";i")):VD%=
shell_StringUpperCase(K$),
shell_StringUpperCase(";"),GB%+1):
GB%>0
VD%>0
K$,GB%+2,VD%-GB%-2)
K$,GB%+2)
I$<>""
_Q%!16=&503:_Q%!&C=_Q%!8:V$=
shell_MessageLookup(I$,"",""):V$=
shell_MessageExpand(V$):$(_Q%+20)=V$:!_Q%=(
V$+25)
&400E7,17,_Q%,_Q%!4
shell_Message_PreQuit(_Q%):
c%,XD%,a%,r%,gD%:
_U%!300>0
shell_HeapBlockFetch(256):
_Q%!0
4:a%!r%=_Q%!r%:
shell_Tracef0("Message_PreQuit:PreQuit message received"):c%=_U%!300:XD%=a%!4:
!a%<24
gD%=0
gD%=a%!20
d2a%!&C=a%!8:
&400E7,19,a%,XD%:
("FN"+$c%)<>0
_closedown%=
!a%=24:a%!24=508:
&400E7,8,a%,XD%:_closedown%=
shell_HeapBlockReturn(a%)
lwaorigin(A,
PA%):OA%=A!0-A!16:PA%=A!&C-A!20:
shell_Iconbar(EA%,q$,H$,hD%,k%,mB%,gB%,_B%):
H$=""
J!_Q%=EA%:_Q%!4=0:_Q%!8=0:_Q%!&C=70:_Q%!16=70:_Q%!20=&301A:$(_Q%+24)=q$
!_Q%=EA%:_Q%!4=0:_Q%!8=-16:_Q%!&C=hD%:_Q%!16=90:_Q%!20=&1700210B:
_Q%!24&C:
_Q%!28
(q$)+2:$(_Q%!24)=H$:$(_Q%!28)="S"+q$:_Q%!32=&C
&400C2,,_Q%
shell_AttachMenu(-2,h%,k%,mB%,gB%,_B%):=h%
shell_IconbarSetText(y%,TF%,L$):
l%,s%:l%=
shell_HeapBlockFetch(40):s%=
shell_HeapBlockFetch(36):s%!20=0:
shell_OSCheckVersion(3)
y%=-1
!s%=-2
!s%=y%
&400CB,,s%
:!l%=y%:l%!4=TF%:
&400CE,,l%:$(l%!28)=L$:
&400D1,-1,l%!8-&64-s%!20,l%!&C,l%!16+&64-s%!20,l%!20:
shell_HeapBlockReturn(l%):
shell_HeapBlockReturn(s%):
shell_WritableIconHandler(b%,g%,LA%):
AB%,kB%,lB%,e%:
sC%,tC%,qA%,oA%,yA%,eF%,z%:z%=
shell_HeapBlockFetch(&400):
&400D3,,z%:
!z%=-1
shell_HeapBlockReturn(z%):=
&400D6,b%,z%,&40E000,&E000:kB%=!z%:e%=0:
z%!e%=g%
sC%=z%!(e%-4):tC%=z%!(e%+4)
:e%+=4:
z%!e%=-1:lB%=z%!(e%-4):
shell_FakeMouseClick(b%,0,4)
398,394:
g%=lB%
&400D2,b%,kB%,-1,-1,-1,
shell_IconGetData(b%,kB%))
&400D2,b%,tC%,-1,-1,-1,
shell_IconGetData(b%,tC%))
399,410:
g%=kB%
&400D2,b%,lB%,-1,-1,-1,
shell_IconGetData(b%,lB%))
&400D2,b%,sC%,-1,-1,-1,
shell_IconGetData(b%,sC%))
&400D2,b%,kB%,-1,-1,-1,
shell_IconGetData(b%,kB%))
&400D2,b%,lB%,-1,-1,-1,
shell_IconGetData(b%,lB%))
shell_HeapBlockReturn(z%):=
shell_FakeMouseClick(b%,g%,pC%):
6,&F,1:_Q%!8=pC%:_Q%!&C=b%:_Q%!16=g%:
shell_Action(6):
shell_IconCreate(b%,sA%,dA%,hD%,y%,vC%,wC%,lE%,P$,nA%,ZB%,K$):
XF%,h%,hB%,l%:l%=
shell_HeapBlockFetch(40):l%!0=b%:l%!4=sA%:l%!8=dA%:l%!&C=sA%+hD%:l%!16=dA%+y%:l%!20=lE%
wC%<<28
vC%<<24:
l%!20
#XF%=
P$,","):l%!24=nA%:
K$<>""
6hB%=
shell_HeapBlockFetch(
K$+1):$hB%=K$:l%!28=hB%
l%!28=-1
:l%!32=ZB%
$(l%+24)=
P$,&B)
&400C2,,l%
shell_HeapBlockReturn(l%):=h%
shell_IconDelete(b%,g%):
shell_DoIconDelete(b%,g%,
shell_IconDelete2(b%,g%):
shell_DoIconDelete(b%,g%,
shell_DoIconDelete(b%,g%,pE%):
a%,GA%,KA%,RA%,ZA%:a%=
shell_HeapBlockFetch(40):a%!0=b%:a%!4=g%:
&400CE,,a%:
"Interface_BoundingBox",,a%+8:GA%=a%!8:KA%=a%!&C:RA%=a%!16:ZA%=a%!20:
&400CE,,a%
shell_HeapBlockExists(a%!28)
shell_HeapBlockReturn(a%!28)
shell_HeapBlockExists(a%!32)
shell_HeapBlockReturn(a%!32)
&400C4,,a%:
&400D1,b%,GA%,KA%,RA%,ZA%
shell_HeapBlockReturn(a%):
shell_IconPutData(IA%,pA%,P$,I):
a%,PA$:PA$=
shell_IconGetData(IA%,pA%):
P$<>PA$
!Sa%=
shell_HeapBlockFetch(40):a%!0=IA%:a%!4=pA%:
&400CE,,a%:
(a%!24
(1<<8))<>0
P$>a%!36
shell_MessageNoArgs("SHELLMSG12")
$(a%!28)=P$
$(a%+28)=
P$,&B)
a%!8=0:a%!&C=0:
&400CD,,a%
shell_HeapBlockReturn(a%)
shell_IconPutDataNow(IA%,pA%,P$):
a%:a%=
shell_HeapBlockFetch(50):a%!0=IA%:a%!4=pA%:
&400CE,,a%:
(a%!24
(1<<8))<>0
P$>a%!36
shell_MessageNoArgs("SHELLMSG12")
$(a%!28)=P$
$(a%+28)=
P$,&B)
:a%!8=0:a%!&C=0:
&400CD,,a%:
shell_EnsurePoll:
shell_HeapBlockReturn(a%):
shell_IconNewSprite(IA%,pA%,VA$,I):
l%:l%=
shell_HeapBlockFetch(40):l%!0=IA%:l%!4=pA%:
&400CE,,l%:
&400C4,,l%:l%!4=l%!8:l%!8=l%!&C:l%!&C=l%!16:l%!16=l%!20:l%!20=l%!24:$(l%+24)=VA$:
&400C2,,l%
&400D1,l%!0,l%!4,l%!8,l%!&C,l%!16
shell_HeapBlockReturn(l%):=pA%
shell_IconGetData(IA%,pA%):
O$,l%:l%=
shell_HeapBlockFetch(40):l%!0=IA%:l%!4=pA%:
&400CE,,l%:
(l%!24
(1<<8))<>0
O$=$(l%!28)
O$=$(l%+28)
shell_HeapBlockReturn(l%):=O$
shell_IconMove2(b%,g%,_D%,AE%):
x%:x%=
shell_HeapBlockFetch(40):!x%=b%:x%!4=g%:
&400CE,,x%:x%!8+=_D%:x%!16+=_D%:x%!&C+=AE%:x%!20+=AE%:g%=
shell_IconMove(b%,g%,x%!8,x%!&C,x%!16,x%!20):
shell_HeapBlockReturn(x%):=g%
shell_IconResize(b%,g%,GA%,KA%,RA%,ZA%):=
shell_IconMove(b%,g%,GA%,KA%,RA%,ZA%)
shell_IconMove(b%,g%,GA%,KA%,RA%,ZA%):
n%,lF%,cF%,uA%,a%:
FE%,GE%,LE%,VE%:n%=
shell_HeapBlockFetch(40):a%=
shell_HeapBlockFetch(40):!n%=b%:n%!4=g%:
&400CE,,n%:!a%=b%:a%!4=g%:
&400CE,,a%:
"Interface_BoundingBox",,a%+8:_E%=n%!24:yC%=n%+28
FE%=_E%:GE%=yC%!0:LE%=yC%!4:VE%=yC%!8:uA%=n%!8-a%!8:
&400C4,,n%:
&400D1,!n%,n%!8-uA%,n%!&C-uA%,n%!16+uA%,n%!20+uA%:g%=
shell_CreateIcon2(b%,GA%,KA%,RA%,ZA%,FE%,GE%,LE%,VE%,uA%):
shell_HeapBlockReturn(n%):
shell_HeapBlockReturn(a%):=g%
shell_CreateIcon2(h%,GA%,KA%,RA%,ZA%,i%,AF%,CF%,DF%,uA%):
w%,FA%,H$,c$,sA%,dA%:FA%=
shell_HeapBlockFetch(60):!FA%=h%:FA%!20=i%:FA%!24=AF%:FA%!28=CF%:FA%!32=DF%:H$="":c$="":
256H$=$(FA%!24)
H$=$(FA%+24)
shell_IconGetCommand(FA%!28,"S")
c$=$(FA%+24)
shell_GetMinXY(i%,H$,c$):
RA%-GA%<sA%
RA%=GA%+sA%
ZA%-KA%<dA%
ZA%=KA%+dA%
FA%!4=GA%:FA%!8=KA%:FA%!&C=RA%:FA%!16=ZA%:
&400C2,,FA%
&400D1,!FA%,FA%!4-uA%,FA%!8-uA%,FA%!&C+uA%,FA%!16+uA%:
&400D3,,FA%:
!FA%=h%:
FA%!4=w%:
&400D2,h%,w%,0,0,-1,0
shell_HeapBlockReturn(FA%):=w%
shell_GetMinXY(i%,H$,c$):
GA%,KA%,RA%,ZA%,oA%,yA%:sA%=0:dA%=0:
H$<>""
&40084,i%>>24
,,KA%,,ZA%:
&40097,,
(i%>>24)+H$
,GA%,,RA%:
&40088,,GA%
,GA%:
&40088,,RA%
,RA%:sA%=RA%-GA%:dA%=ZA%-KA%
sA%=6*pF%+16*
H$:dA%=32
4dA%+=2*bF%
c$<>""
&2002E,296,
shell_UserSpritesBase,c$
,,,oA%,yA%,,YE%;P%:
&20035,YE%,4
,,JF%:oA%=oA%<<JF%:
&20035,YE%,5
,,KF%:yA%=yA%<<KF%:
&800oA%=oA%/2:yA%=yA%/2
539)=19oA%=sA%+oA%
oA%>sA%sA%=oA%
yA%>dA%dA%=yA%
shell_IconGetCommand(WC%,gA$):
I%,O$:
WC%<=0
O$=""
shell_StringUpperCase($WC%),";"+
shell_StringUpperCase(gA$)):
O$=""
$(WC%+I%),
$(WC%+I%)+";",";")-1)
shell_IconRedraw(b%,g%):
a%:a%=
shell_HeapBlockFetch(40):!a%=b%:a%!4=g%:
&400CE,,a%:
"Interface_BoundingBox",,a%+8:
&400D1,b%,a%!8,a%!&C,a%!16,a%!20:
shell_Action(
shell_Poll_I(0,_U%!&94)):
shell_HeapBlockReturn(a%):
shell_IconGetValidation(b%,g%):
a%,K$,i%:
g%=-1
VK$="":a%=
shell_HeapBlockFetch(&64):a%!0=b%:a%!4=g%:
&400CE,,a%:i%=a%!24:
a%!32>0
K$=$(a%!32)
shell_HeapBlockReturn(a%):=K$
shell_IconPutValidation(b%,g%,t$):
a%,i%:a%=
shell_HeapBlockFetch(&64):a%!0=b%:a%!4=g%:
&400CE,,a%:i%=a%!24:
$(a%!32)=t$
shell_HeapBlockReturn(a%):
shell_IsIconSelected(HB%,IB%):
shell_IconGetState(HB%,IB%):i%=_Q%!24:c%=(i%
&200000):
shell_IconSelect(HB%,IB%):
shell_IconSetState(HB%,IB%,&200000,&200000):
shell_IconDeselect(HB%,IB%):
shell_IconSetState(HB%,IB%,0,&200000):
shell_IconGetState(HB%,IB%):!_Q%=HB%:_Q%!4=IB%:
&400CE,,_Q%:
shell_IconSetSelected(b%,g%,WA%):
WA%=0
shell_IconDeselect(b%,g%)
shell_IconSelect(b%,g%)
shell_IconSet(b%,g%,WA%):
WA%=0
shell_IconDeselect(b%,g%)
shell_IconSelect(b%,g%)
shell_IconSetState(HB%,IB%,PF%,QF%):
l%:l%=
shell_HeapBlockFetch(16):!l%=HB%:l%!4=IB%:l%!8=PF%:l%!&C=QF%:
&400CD,,l%:
shell_HeapBlockReturn(l%):
shell_IconUnselectable(h%,zB%):
shell_IconSetState(h%,zB%,&400000,&40000):
shell_IconSetBGColour(b%,g%,aB%):
aB%<0
aB%>&F
shell_MessageOneArg("SHELLMSG24","PROCshell_IconSetBGColour")
shell_IconSetState(b%,g%,aB%<<28,&F0000000):
shell_IconSetFGColour(b%,g%,aB%):
aB%<0
aB%>&F
shell_MessageOneArg("SHELLMSG24","PROCshell_IconSetFGColour")
shell_IconSetState(b%,g%,aB%<<24,&F000000):
shell_CaretSetPosition(IA%,pA%,YF%,ZF%,QA%,qA%):
&400D2,IA%,pA%,YF%,ZF%,QA%,qA%:
shell_IconSetButtonType(b%,g%,AC%):
AC%=&C
AC%=&D
shell_MessageOneArg("SHELLMSG23","PROCshell_IconSetButtonType")
AC%<0
AC%>&F
shell_MessageOneArg("SHELLMSG22","PROCshell_IconSetButtonType")
shell_IconSetState(b%,g%,AC%<<&C,&F000):
shell_IconSetESG(b%,g%,nB%):
nB%<0
nB%>31
shell_MessageOneArg("SHELLMSG25","PROCshell_IconSetESG")
shell_IconSetState(b%,g%,nB%<<16,&1F0000):
shell_IconSetText(b%,g%,AA%):
AA%<>0
AA%=1<<0
shell_IconSetState(b%,g%,AA%,1<<0):
shell_IconSetSprite(b%,g%,AA%):
AA%<>0
AA%=1<<1
shell_IconSetState(b%,g%,AA%,1<<1):
shell_IconSetBorder(b%,g%,AA%):
AA%<>0
AA%=1<<2
shell_IconSetState(b%,g%,AA%,1<<2):
shell_IconSetHCentred(b%,g%,AA%):
shell_IconSetState(b%,g%,0,1<<9):
AA%<>0
AA%=1<<3
shell_IconSetState(b%,g%,AA%,1<<3):
shell_IconSetVCentred(b%,g%,AA%):
AA%<>0
AA%=1<<4
shell_IconSetState(b%,g%,AA%,1<<4):
shell_IconSetFilled(b%,g%,AA%):
AA%<>0
AA%=1<<5
shell_IconSetState(b%,g%,AA%,1<<5):
shell_IconSetRightJust(b%,g%,AA%):
shell_IconSetHCentred(b%,g%,0):
AA%<>0
AA%=1<<9
shell_IconSetState(b%,g%,AA%,1<<9):
shell_IconSetLeftJust(b%,g%):
shell_IconSetHCentred(b%,g%,0):
shell_IconSetRightJust(b%,g%,0):
shell_IconSetUnselectable(b%,g%,WA%):
WA%<>0
WA%=1<<22
shell_IconSetState(b%,g%,WA%,1<<22):
WA%<>0
shell_HeapBlockFetch(24):
&400D3,,z%:
!z%=b%
z%!4=g%
&400D2,-1
shell_HeapBlockReturn(z%)
shell_CaretSetRight(b%,g%):
&400D2,b%,g%,-1,-1,-1,
shell_IconGetData(b%,g%)):
print_text(F,G,H$):
in(F,G-32,F+16*
(H$),G)
in(A%,B%,C%,D%):
newvals:Y=_Q%!28:Q=_Q%!32:Z=_Q%!36:P=_Q%!40:T=_Q%!4:V=_Q%!8:U=_Q%!&C:O=_Q%!16:K=_Q%!20:L=_Q%!24:R=U-T:S=O-V:d=K:e=K+R:f=L:b=L-S:
max(DA%,eA%):
DA%<eA%
shell_Leaf(G$):
G$,"."):G$=
G$,".")+1):
shell_Branch(e$):
EA%,v$,c%:
e$,".")=0
v$=""
c%=0:
:EA%=c%+1:c%=
e$,".",EA%):
c%=0:v$=
e$,EA%-2)
gname(C):w$="":
?C<>0
?C<>&D:w$=w$+
?C:C+=1:
shell_WindowResize(IA%,zE%,aF%,rE%,uE%,ZC%):!_Q%=zE%:_Q%!4=aF%:_Q%!8=rE%:_Q%!&C=uE%:
&400D7,IA%,_Q%:
)_Q%!0=IA%:
&400CC,,_Q%:
&400C5,,_Q%
shell_WindowRetitle(
IA%,R$):
c%,p%,h%,pD%:p%=
shell_HeapBlockFetch(&64+(
shell_WindowCountIcons(IA%)*32)):p%!0=IA%:
&400CC,,p%:
((p%!60)
256)=0
)Ac%=p%+76:$c%=
R$,&B):
&400C3,,p%:
&400C1,,p%+4
h%<>IA%
shell_UpdateWindowHandle(IA%,h%):IA%=h%
pD%=p%!84:$(!(p%+76))=
R$,pD%-1):
((p%!32)
(1<<16))<>0
&400D1,-1,p%!4,p%!16,p%!&C,p%!16+44
shell_HeapBlockReturn(p%)
shell_WindowTitleIndirected(CC%):
(1<<8))=(1<<8)
shell_ScreenToWindowCoords(qD%,
BD%,rD%,kF%,sD%,tD%,bB%:bB%=
shell_HeapBlockFetch(&64+(
shell_WindowCountIcons(qD%)*32)):BD%=bB%:!BD%=qD%:
&400CC,,BD%:rD%=bB%!4:GF%=bB%!16:sD%=bB%!20:tD%=bB%!24:X%=X%+(sD%-rD%):Y%=Y%+(tD%-GF%)
shell_HeapBlockReturn(bB%):
shell_WimpSlotReadEnd:
&400EC,-1,-1
oB%:=oB%
shell_WimpSlotClaimMemory(oB%,bA%):
&400EC,oB%+bA%,-1
CD%<oB%+bA%
shell_WimpSlotReleaseMemory:
&400EC,oB%,-1:
shell_MouseLimit(A,IA%):A!0=IA%:
&400CB,,A:
mouse_rectangle(A!4,A!8,A!&C-A!4,A!16-A!8):
shell_NameOfFirstSprite(WA$):
X%,N%,x$:X%=
(WA$):
#X%=4:N%=
#X%:N%+=
#X%*256:N%+=
#X%*65536:N%+=
#X%*&1000000:
#X%=N%:x$="":
&B:x$+=
#X%):
#X%:=x$
InitialiseSpriteArea(S%,SF%):!S%=SF%:S%!8=16:
46,9+256,S%:
shell_ListEvents(b%,w%):
k%,a$:
b%=-1
b%=-2
shell_Tracef0("MenuSelection="+
shell_GetEventHandler(b%,w%,0)):
shell_Tracef0("MenuMaker ="+
shell_GetEventHandler(b%,w%,1)):
shell_Tracef0("ClickSelect ="+
shell_GetEventHandler(b%,w%,2))
shell_Tracef0("ClickAdjust ="+
shell_GetEventHandler(b%,w%,3)):
shell_Tracef0("Redraw ="+
shell_GetEventHandler(b%,w%,4)):
shell_Tracef0("Keypress ="+
shell_GetEventHandler(b%,w%,5))
shell_Tracef0("Drag ="+
shell_GetEventHandler(b%,w%,6)):
shell_Tracef0("Menu Warning ="+
shell_GetEventHandler(b%,w%,7)):
shell_Tracef0("HelpTag ="+
shell_GetEventHandler(b%,w%,8)):k%=
shell_GetEventMenu(2,b%,w%):
a$="None"
shell_Tracef0("Menu handle =&"+a$):
shell_HeapManagerInit(G$,VF%):
_heap_code%900:
("LOAD "+G$+"heapcode "+
~_heap_code%):
_heap_code%+0,VF%:
shell_HeapBlockExists(nA%):
nA%<&8000
99,"No heapblock defined at this address"
shell_HeapBlockInfo(nA%):
shell_HeapBlockExtend(DA%,eA%):
_heap_code%+&C,DA%,eA%:=DA%
shell_HeapBlockFetch(DA%):
_heap_code%+4,nA%,DA%:=nA%
shell_HeapBlockReturn(
DA%):
shell_HeapBlockExists(DA%)
_heap_code%+8,DA%
DA%=0:
shell_HeapBlockInfo(DA%):
29,6,!(_heap_code%+28),DA%
,,,M:=M
shell_OSVarExists(KB%,y$):
&20023,y$,KB%,-1,0,0
shell_OSVarGetVal(KB%,bA%,y$,W):
z$,B,WF%:
&20023,y$,KB%,bA%,0,-3*(W=
,,B,WF%,u%:
B-1:z$=z$+
(KB%?r%):
r%:=z$
shell_OSReadCommandArg(X):
DD%,T$,d%:T$="":d%=0:
DD%?d%<>0:T$+=
(DD%?d%):d%+=1:
1:T$=
34)+1):T$=
34)+2)
shell_StringStripTrailing(B$,U$):
B$,1)=U$:B$=
(B$)-1):
shell_StringStripLeading(B$,U$):
B$,1)=U$:B$=
B$,2):
shell_StringStripAll(B$,U$):
D,E:D=
B$,U$):
B$,E-1)+
B$,E+1)
D:=B$
shell_StringPadTrailing(B$,U$,vA%):
(B$)<vA%:B$=B$+
(B$),U$):
shell_StringPadLeading(B$,U$,vA%):
(B$)<vA%:B$=
(B$),U$)+B$:
shell_StringUpperCase(B$):
(B$)>0
(B$):
B$,r%,1)>="a"
B$,r%,1)<="z"
B$,r%,1)=
B$,r%,1))
shell_StringExchange(B$,BA$,dA$):
B$,BA$)
S0qA%=
B$,BA$):B$=
B$,qA%-1)+dA$+
B$,qA%+
shell_StringArrayGetLongest(A$(),aC%):
r%,bC%:bC%=0:
(A$(r%))>bC%
(A$(r%))
r%:=bC%
mem_to_string(wD%,d%,nE%):
wD%?d%<>nE%:B$+=
(wD%?d%):d%+=1:
shell_FileLength(Z$):
u%,YC%,fC%,vA%,pB%,B$:
8,5,Z$
u%,,YC%,fC%,vA%,pB%:=vA%
shell_TraceOn:_U%!&64=_U%!&64
1<<9:
shell_BroadcastMessage(&43B00,"ShellDBug:TraceOn"):
shell_TraceOff:
(_U%!&64
(1<<9))
_U%!&64=_U%!&64
(1<<9)
shell_BroadcastMessage(&43B00,"ShellDBug:TraceOff"):
shell_TraceInit(h$):
JA%,a%,E$,D$:
h$<>""
(h$):_U%!44=JA%
shell_HeapBlockFetch(256):D$=
shell_OSVarGetVal(a%,256,"Obey$Dir",1):E$=
shell_Leaf(D$),2):
shell_BroadcastMessage(&43B00,"ShellDBug:Init Debug messages from "+E$):
shell_HeapBlockReturn(a%):
_U%!&64
_U%!&64=(_U%!&64
1<<4)
shell_TraceIsOn:
_U%!&64
(1<<9)
shell_Tracef0(KA$):
shell_TraceIsOn)
_U%!44<>-1
JA%=_U%!44:
#JA%,KA$
_U%!&94>0
shell_BroadcastMessage(&43B00,"ShellDBug:Trace "+KA$)
shell_Tracef2(nA%):
("MEDIT "+
~nA%):
shell_TraceExit:
_U%!44<>-1
#(_U%!44):_U%!44=-1
shell_AttachHotKey(LA$,mB%,gB%,_B%,M$,b%,S$,X$):
v%,d%,c%,_%,LA%,FD%:FD%=
_U%!60=0
3_U%!60=
shell_HeapBlockFetch(24):d%=0:_U%!&B4=1
d%=_U%!&B4*24:_U%!60=
shell_HeapBlockExtend(_U%!60,24):_U%!&B4=(_U%!&B4)+1
:v%=_U%!60:
"F1":LA%=385
"F2":LA%=386
"F3":LA%=387
"F4":LA%=388
"F5":LA%=389
"F6":LA%=390
"F7":LA%=391
"F8":LA%=392
"F9":LA%=393
"F10":LA%=458
"F11":LA%=459
LA%=(
LA$)-64:FD%=
LA%+=16
LA%+=32
:c%=v%+d%:c%!0=LA%:c%?4=mB%:c%?5=gB%:c%?6=_B%:c%!8=
shell_HeapBlockFetch(
M$+1):_%=c%!8:$_%=M$:
shell_SearchStatic(_U%!&B8,b%):
d%=-1
shell_MessageNoArgs("SHELLMSG09")
:c%!&C=b%:c%!16=
shell_HeapBlockFetch(
S$+1):_%=c%!16:$_%=S$:c%!20=
shell_HeapBlockFetch(
X$+1):_%=c%!20:$_%=X$:
shell_HotKeyProcess(LA%):
v%,q%,m%,f%,y%,i$,S$,X$:
gB%,mB%,_B%,rA%,tA%,CC%,nF%,d%:
BA%,p%:v%=_U%!60:q%=_U%!&B4*24:m%=
:f%=0:
v%!f%=LA%
f%+=24
f%>=q%:
dc%=v%+f%:i$=$(c%!8):
shell_Tracef0("HotKeyProcess:Template name is '"+i$+"'"):
(i$<>""
c%!&C=0)
shell_CreateWindow(i$,y%):
shell_Tracef0("HotKeyProcess:Creating new dynamic window (handle is &"+
~y%+")"):p%=
shell_HeapBlockFetch(36):p%!0=y%:
&400CB,,p%:rA%=(p%!4-p%!&C)/2:tA%=(p%!16-p%!8)/2:
shell_HeapBlockReturn(p%)
:S$=$(c%!16):
S$<>""
shell_Tracef0("HotKeyProcess:Calling Pre-Open FN '"+S$+"'"):
c%!&C>0
% o%=
("FN"+S$+"("+
c%!&C+")")
("FN"+S$+"("+
y%+")")
shell_Tracef0("HotKeyProcess:No Pre-Open FN registered")
shell_SearchStatic(_U%!&B8,c%!&C):
d%>-1
shell_OpenWindowStatic(c%!&C)
c%!&C>0
shell_MessageNoArgs("SHELLMSG09")
shell_OpenWindowDynamic(y%,rA%,tA%)
:X$=$(c%!20):
X$<>""
shell_Tracef0("HotKeyProcess:Calling Post-Open FN '"+X$+"'"):
c%!&C>0
A o%=
("FN"+S$+"("+
c%!&C+")")
("FN"+X$+"("+
y%+")")
shell_Tracef0("HotKeyProcess:No Post-Open FN registered")
:BA%=
i$="":S$="":X$="":BA%=
:=BA%
shell_WindowCentreOnPointer(y%):
s%,BC%,rA%,tA%:BC%=
shell_HeapBlockFetch(20):
&400CF,,BC%:p%=
shell_HeapBlockFetch(36):p%!0=y%:
&400CB,,p%:rA%=(p%!4-p%!&C)/2:tA%=(p%!16-p%!8)/2:
shell_WindowMoveTo(y%,BC%!0+rA%,BC%!4-tA%)
shell_HeapBlockReturn(p%):
shell_HeapBlockReturn(BC%):
shell_WindowCentreOnScreen(y%):
s%,dC%,eC%,mA%,QA%,LC%,cB%:
&20035,-1,4
,,LC%:
&20035,-1,5
,,cB%:
&20035,-1,&B
,,dC%:
&20035,-1,&C
,,eC%:dC%=dC%<<LC%:eC%=eC%<<cB%:p%=
shell_HeapBlockFetch(36):p%!0=y%:
&400CB,,p%:mA%=(p%!&C-p%!4)
peQA%=(p%!16-p%!8):
shell_WindowMoveTo(y%,(dC%/2)-(mA%/2),(eC%-QA%)/2):
shell_HeapBlockReturn(p%):
shell_OpenWindowStaticNewView(b%):
shell_OpenWindow(b%,
,-1):
shell_OpenWindowStatic(h%):
shell_SearchStatic(_U%!&B8,h%)>-1
shell_OpenWindow(h%,0,-1)
shell_SearchStatic(aA%,h%):
m%,e%:m%=-1:e%=0:
aA%<>0
aA%!e%<>-1:
aA%!e%=h%
m%=e%:=m%
:e%+=4:
shell_CreateWindowStatic(CA$,
WB%,aA%,c%,d%:WB%=
shell_GetWB(CA$):WB%!64=_U%!16:
&400C1,,WB%
h%:aA%=_U%!&B8:
aA%=0
shell_Tracef0("CreateWindowStatic:Empty List"):_U%!&B8=
shell_HeapBlockFetch(8):aA%=_U%!&B8:aA%!0=h%:aA%!4=-1
shell_Tracef0("CreateWindowStatic:Searching for window handle"):d%=
shell_SearchStatic(_U%!&B8,h%):
d%=-1
shell_Tracef0("CreateWindowStatic:Not found - adding window handle to list"):d%=
shell_SearchStatic(_U%!&B8,0):
d%=-1
shell_Tracef0("CreateWindowStatic:Extending window handle list"):e%=0:
aA%!e%<>-1:e%+=4:
:_U%!&B8=
shell_HeapBlockExtend(_U%!&B8,4):aA%=_U%!&B8
shell_Tracef0("CreateWindowStatic:Found unused space in list"):e%=d%
:c%=aA%+e%:c%!0=h%:c%!4=-1
shell_InitHelpSystem(G$,xE%):
DA$,EA%,hA%,Y$,HD%,NB%:_U%!&D4=0:
_U%!&D8<>0
shell_HeapBlockReturn(_U%!&D8)
@_U%!&D8=0:
shell_ScanForHelp:
DA$=" -DieWithTask"
DA$=""
_U%!&64
G$="":hA%=
shell_HeapBlockFetch(256):Y$=
shell_OSVarGetVal(hA%,256,
shell_GetAppName+"Res$Path",-1):
shell_HeapBlockReturn(hA%):
:EA%=
Y$,","):
EA%>0
shell_FileExists(
Y$,EA%-1)+
shell_GetAppName)
Y$,EA%-1)+
shell_GetAppName:
shell_StrongHlpChkFiles(G$)
Y$,EA%+1)
shell_FileExists(Y$+
shell_GetAppName)
?G$=Y$+
shell_GetAppName:
shell_StrongHlpChkFiles(G$)
shell_OK(
shell_MessageOneArg("SHELLMSG26",
shell_GetAppName))
G$<>""
shell_FileExists(G$)
shell_StrongHlpChkFiles(G$)
shell_MessageOneArg("SHELLMSG33",G$)
NB%=0
shell_StrongHlpMsg("Help_Install "+G$+DA$):_U%!&64=_U%!&64
shell_HelpWord(EA$):
oF%,c%,CA%:CA%=
shell_HeapBlockFetch(512):
_U%!&D0=-1
shell_OSVarExists(CA%,"StrongHelp$Dir")
&600DE,"<StrongHelp$Dir>":
_U%!&D8<>0
shell_HeapBlockReturn(_U%!&D8)
<_U%!&D8=
shell_HeapBlockFetch(
EA$+1):c%=_U%!&D8:$c%=EA$
shell_HeapBlockReturn(CA%):
shell_OK(
shell_MessageNoArgs("SHELLMSG11"))
shell_StrongHlpMsg("Help_Word "+EA$)
shell_HeapBlockReturn(CA%):
shell_StrongHlpMsg(n$):
shell_BroadcastMessage(&43B00,n$):
shell_ScanForHelp:
JB%,gC%:JB%=
shell_HeapBlockFetch(256):
:JB%!&C=0:
&400E7,19,JB%,-2,_U%!&D4
,,gC%:_U%!&D4=_U%!&D4+1:
gC%<>-1
(_U%!&D4)>64:
gC%<>-1
9@JB%!0=24:JB%!&C=0:JB%!16=&400C6:JB%!20=gC%:
&400E7,17,JB%,0
shell_HeapBlockReturn(JB%):
shell_BroadcastMessage(IF%,n$):
x%,KD%:KD%=(
n$+30)
3:x%=
shell_HeapBlockFetch(KD%):x%!&C=0:x%!16=IF%:$(x%+20)=n$+
(0):x%!0=KD%:
&600E7,17,x%,0:
shell_HeapBlockReturn(x%):
shell_WindowToggleBackIcon(
shell_WindowToggleFlags(b%,1<<24):
shell_WindowToggleCloseIcon(
shell_WindowToggleFlags(b%,1<<25):
shell_WindowToggleTitleBar(
shell_WindowToggleFlags(b%,1<<26):
shell_WindowToggleToggleIcon(
shell_WindowToggleFlags(b%,1<<27):
shell_WindowToggleHScrollBar(
shell_WindowToggleFlags(b%,1<<30):
shell_WindowToggleAdjustSizeIcon(
shell_WindowToggleFlags(b%,1<<29):
shell_WindowToggleVScrollBar(
shell_WindowToggleFlags(b%,1<<28):
shell_WindowToggleFlags(
b%,rB%):
a%,i%,ZC%,h%:
shell_Tracef0("WindowToggleFlags:wh%=&"+
~b%):ZC%=
shell_WindowIsOpen(b%):a%=
shell_HeapBlockFetch(&64+(
shell_WindowCountIcons(b%)*32)):a%!0=b%:
&400CC,,a%:i%=a%!32:i%=(i%
rB%):a%!32=i%:
&400C3,,a%
&400C1,,a%+4
h%:!a%=h%:
&400C5,,a%
shell_HeapBlockReturn(a%):
h%<>b%
shell_UpdateWindowHandle(b%,h%):b%=h%
shell_ListClickSelect:
v%,f%,q%,c%,_%:v%=_U%!&C:q%=
shell_HeapBlockInfo(v%):
shell_Tracef0(" "):
shell_Tracef0("List of ClickSelect events:"):f%=0:
:c%=v%!(f%+20):_%=v%+f%:
shell_HeapBlockExists(c%)
$c%<>""
shell_Tracef0("&"+
shell_StringPadTrailing(
~_%!0," ",8)+" &"+
shell_StringPadTrailing(
~_%!4," ",8)+" "+$c%)
:f%+=48:
(f%>=q%):
shell_Tracef0(" "):
shell_ListClickAdjust:
v%,f%,q%,c%,_%:v%=_U%!&C:q%=
shell_HeapBlockInfo(v%):
shell_Tracef0(" "):
shell_Tracef0("List of ClickAdjust events:"):f%=0:
:c%=v%!(f%+24):_%=v%+f%:
shell_HeapBlockExists(c%)
$c%<>""
shell_Tracef0("&"+
shell_StringPadTrailing(
~_%!0," ",8)+" &"+
shell_StringPadTrailing(
~_%!4," ",8)+" "+$c%)
:f%+=48:
(f%>=q%):
shell_Tracef0(" "):
shell_ListHelpTags:
v%,f%,q%,c%,_%:v%=_U%!&C:q%=
shell_HeapBlockInfo(v%):
shell_Tracef0(" "):
shell_Tracef0("List of attached help tags:"):f%=0:
:c%=v%!(f%+44):_%=v%+f%:
shell_HeapBlockExists(c%)
$c%<>""
shell_Tracef0("&"+
shell_StringPadTrailing(
~_%!0," ",8)+" &"+
shell_StringPadTrailing(
~_%!4," ",8)+" "+$c%)
:f%+=48:
(f%>=q%):
shell_Tracef0(" "):
shell_MemFill(DC%,DE%,EE%):
I%,hC%,ND%:hC%=DE%
4:ND%=DE%
hC%>0
(hC%*4)
4:DC%!(I%-1)=EE%:
ND%>0
.DC%=DC%+(hC%*4):
ND%-1:DC%?I%=EE%:
shell_AttachFontMenu(b%,g%,J$,OA$):
shell_FontMenuInit:
"FontMenu_Select",""+
0,_U%!260
,k%:_U%!&FC=k%:
shell_EventAdd(b%,g%,0,-2,J$):
shell_Tracef0("AttachFontMenu:Attaching font menu"):
OA$<>""
shell_AttachMenuMaker(b%,g%,OA$)
shell_AttachFontSubMenu(CB%,C$,J$):
iF%,k%,c%,e%:
shell_FontMenuInit:
"FontMenu_Select",""+
0,_U%!260
&45BCE,CB%,k%:
&45BCC,,
:_U%!&FC=k%:
shell_EventListMenuWarn(CB%,k%,C$,J$):
shell_Tracef0("AttachFontSubMenu:Attaching font menu &"+
~k%):
shell_FontMenuInit:
("RMEnsure FontMenu 1.16 RMLoad <EvntShellSystem$Path>FontMenu"):
("RMEnsure FontMenu 1.16 Error Couldn't load FontMenu module"):
_U%!&F0=-1
"FontMenu_Create"
_U%!&F0
shell_FontMenuSelectFont("",
shell_FontMenuSelectFont(o$,OD%):
c%,_A%:
shell_HeapBlockExists(_U%!&F4)
shell_HeapBlockReturn(_U%!&F4)
7H_U%!&F4=
shell_HeapBlockFetch(
o$+1):c%=_U%!&F4:$c%=o$:
OD%<>0
OD%=1
:B_U%!260=OD%:
"FontMenu_Select",o$,_U%!260
,_A%:
_A%<>_U%!&FC
shell_FontMenuUpdatePtr(_A%):_U%!&FC=_A%
shell_Tracef0("FontMenuSelectFont:Font is '"+o$+"'"):
shell_FontMenuGetLastSelectedFont:
shell_HeapBlockExists(_U%!&F4)
c%=_U%!&F4:=$c%
shell_FontMenuUpdatePtr(f%):
v%,e%:
shell_Tracef0("FontMenuUpdatePtr:Started.."):
shell_HeapBlockExists(_U%!&DC)
shell_Tracef0("FontMenuUpdatePtr:HeapBlock found.."):v%=_U%!&DC:e%=0:
shell_Tracef0("FontMenuUpdatePtr:Substituting ptr.."):v%!(e%+8)=f%:e%+=&C:
v%!e%=-1
shell_MenuUpdateHandle(HE%,IE%):
q%,f%,j%,k%:q%=
shell_HeapBlockInfo(_U%!&C)-8:f%=0:m%=
:j%=_U%!&C:
:k%=j%!(f%+8):
k%=HE%
j%!(f%+8)=IE%
p+f%+=48:
(f%>=q%):
_U%!24=HE%
_U%!24=IE%
shell_FindFont(
b$,iC%,jC%,
PD%):
shell_FontIsAvailable(b$,iC%,jC%)
b$="Trinity.Medium"
&40081,,b$,iC%*16,jC%*16,0,0
shell_FontIsAvailable(b$,iC%,jC%):
&40081,0,b$,iC%*16,jC%*16,0,0
&40082,PD%:=
shell_CheckSelection(mE%):
c%,e%:c%=_U%!256:
_U%!24=_U%!&FC
mE%!e%<>c%!e%
e%+=4:
c%!e%=-1:=e%
shell_MenuGetItemAddress(k%,ME%):
e%,VB%:
&45BC7,k%
:VB%=k%+28+((ME%!e%)*24):k%=VB%!4:e%+=4:
ME%!e%=-1:=VB%
shell_GetLastMouseXPos:=_U%!272
shell_GetLastMouseYPos:=_U%!276
shell_UpdateWindowHandle(SA%,MA%):
shell_Tracef0("UpdateWindowHandle:Updating stored window handles"):
shell_Tracef0("UpdateWindowHandle:old handle=&"+
~SA%):
shell_Tracef0("UpdateWindowHandle:new handle=&"+
~MA%):
MA%<>SA%
_U%!28=SA%
_U%!28=MA%
shell_FixEventBlock(SA%,MA%,_U%!&C,48):
shell_FixEventBlock(SA%,MA%,_U%!96,16):
shell_FixEventBlock(SA%,MA%,_U%!72,24):
shell_FixEventBlock(SA%,MA%,_U%!92,24):
shell_FixEventBlock(SA%,MA%,_U%!&68,16):
shell_UpdateStaticWindows(SA%,MA%)
shell_UpdateStaticWindows(SA%,MA%):
d%,aA%:
shell_Tracef0("UpdateStaticWindows:Correcting static window list.."):aA%=_U%!&B8:d%=
shell_SearchStatic(_U%!&B8,SA%):aA%!d%=MA%:
shell_FixEventBlock(SA%,MA%,j%,d%):
f%,q%:
shell_HeapBlockExists(j%)
shell_HeapBlockInfo(j%)-8:
(j%!f%=SA%)
j%!f%=MA%
:f%+=d%:
(f%>=q%)
shell_IconSelectAll(b%):
a%,I%:a%=
shell_HeapBlockFetch(&7D0):I%=a%+64:!a%=b%:a%!8=1<<21:a%!&C=1<<21:
&400D6,!a%,I%,5<<21,0<<21:
!I%>-1:a%!4=!I%:
&400CD,,a%:I%+=4:
shell_HeapBlockReturn(a%):
shell_IconDeselectAll(b%):
a%,I%:a%=
shell_HeapBlockFetch(&7D0):I%=a%+64:!a%=b%:a%!8=0:a%!&C=1<<21:
&400D6,!a%,I%,5<<21,1<<21:
!I%>-1:a%!4=!I%:
&400CD,,a%:I%+=4:
shell_HeapBlockReturn(a%):
shell_Message_SaveDesktop(Q%):
GA$:GA$="Run "+
shell_GetAppDir+
&C,2,Q%!20,GA$,
shell_MessagesInit(F$,
NE%):
bA%,i%:
3,"Cannot open message file '"+F$+"'"
&41500,,F$
i%,,bA%:
NE%=0
shell_HeapBlockFetch(bA%)
30,6,,,17+
,,kC%:$(kC%+16)=F$:
&41501,kC%,kC%+16:
shell_Tracef0("MessagesInit:Message resource file '"+F$+"' loaded"):
shell_PrinterOnLine:
OE%,PE%:OE%=
(-4):
2,1,0,1,0,1,0:
>30:PE%=
(-4)<OE%):*FX21,3
3:=PE%
shell_AttachBumpHandler(b%,g%,QE%,RE%,sE%,tE%,SE%,vE%,HA$,IA$):
XA%,d%,c%,_%,gA%:d%=
shell_GetEventListOffset(b%,QE%,_U%+&68,16,
):XA%=_U%!&68+d%:XA%!0=b%:XA%!4=QE%:XA%!8=SE%:XA%!&C=
shell_HeapBlockFetch(24):gA%=XA%!&C:gA%!0=g%:gA%!4=sE%:gA%!8=tE%
HA$>0
H<gA%!&C=
shell_HeapBlockFetch((
HA$)+1):_%=gA%!&C:$_%=HA$
gA%!&C=0
IA$>0
N<gA%!16=
shell_HeapBlockFetch((
IA$)+1):_%=gA%!16:$_%=IA$
gA%!16=0
vE%=-1
gA%!20=1
gA%!20=0
Usd%=
shell_GetEventListOffset(b%,RE%,_U%+&68,16,
):XA%=_U%!&68+d%:XA%!0=b%:XA%!4=RE%:XA%!8=SE%*(-1):XA%!&C=gA%:
shell_HandleBumpIcons(d%,b%,g%,_button%):
hF%,HA%,XA%,FC%,_temp$,QD%:
mF%,dB%:
_button%<>2
dRXA%=_U%!&68+d%:_U%!288=b%:_U%!292=g%:_U%!296=d%:HA%=XA%!&C:QD%=HA%!16:
QD%<>0
nC_temp$=
shell_IconGetData(b%,HA%!0):FC%=
("FN"+$QD%+"(_temp$)")
shell_IconGetData(b%,HA%!0))
_button%=1
u _new_val%=FC%+((XA%!8)*(-1))
_new_val%=FC%+XA%!8
HA%!20=0
_new_val%>HA%!8
_new_val%=HA%!8
_new_val%<HA%!4
_new_val%=HA%!4
_new_val%>HA%!8
_new_val%=HA%!4
_new_val%<HA%!4
_new_val%=HA%!8
:dB%=HA%!&C:
dB%<>0
1_new_val$=
("FN"+$dB%+"(_new_val%,_button%)")
_new_val$=
_new_val%
_new_val%<>FC%
shell_IconPutData(b%,HA%!0,_new_val$,-1)
shell_WindowSetSpriteArea(y%,RD%):
a%,MA%,zB%,SD%:a%=
shell_HeapBlockFetch(&64+(
shell_WindowCountIcons(y%)*32)):!a%=y%:
&400CC,,a%:a%!68=RD%:
shell_IconSetSpriteArea(a%!60,a%+76,RD%):
(a%!88)>0
zB%=0
(a%!88)-1:SD%=a%+92+zB%*32:
shell_IconSetSpriteArea(SD%!16,SD%+20,RD%):
&400C3,,a%:
&400C1,,a%+4
MA%<>y%
shell_UpdateWindowHandle(y%,MA%):y%=MA%
shell_HeapBlockReturn(a%):=y%
shell_IconSetSpriteArea(i%,GC%,BF%):
3)=2)
256)<>0)
GC%!4=BF%
shell_StrongHlpIsAvailable:
wA%,CA%:wA%=
_U%!&64
kCA%=
shell_HeapBlockFetch(256):wA%=
shell_OSVarExists(CA%,"StrongHelp$Dir"):
shell_HeapBlockReturn(CA%)
:=wA%
shell_MenuNew(R$):
&45BC1,,R$
h%:=h%
shell_MenuAdd(h%,QA$,J$):
J$<>""
&45BC2,h%,QA$,J$
&45BC2,h%,QA$
:=UD%
shell_MenuTick(fA%,WA%):
&45BC9,fA%,WA%:
shell_MenuTickOnly1(TA%,EA%):
&45BD1,TA%,EA%:
shell_MenuTickOnly2(fA%):
&45BD1,fA%:
shell_MenuShade(h%,WA%):
&45BCB,h%,WA%:
shell_MenuDotted(fA%,WA%):
&45BCA,fA%,WA%:
shell_MenuColours(fA%,vC%,wC%):
&45BD0,fA%,vC%,wC%:
shell_MenuWritable(fA%,WA%,bA%,t$):
&45BCD,fA%,WA%,bA%,t$:
shell_MenuPutData(fA%,P$):
&45BC8,fA%,P$:
shell_MenuCallHandler(y%,_h_blk%):
("FN"+$y%+"(_h_blk%)")
shell_AttachOpenWindow(b%,A$):
a%,c%,d%:
shell_Tracef0("AttachOpenWindow:Attaching OpenWindow Handler"):
shell_MessageOneArg("SHELLMSG27","AttachOpenWindow")
shell_GetEventListOffset(b%,-1,_U%+304,&C,
):a%=_U%!304+d%:a%!0=b%:a%!4=-1:a%!8=
shell_HeapBlockFetch(
(A$)+1):c%=a%!8:$c%=A$:
shell_AttachCloseWindowHandler(b%,A$):
a%,c%,d%:
shell_Tracef0("AttachCloseWindowHandler:Attaching CloseWindow Handler"):
shell_MessageOneArg("SHELLMSG27","AttachCloseWindow")
shell_GetEventListOffset(b%,-1,_U%+308,&C,
):a%=_U%!308+d%:a%!0=b%:a%!4=-1:a%!8=
shell_HeapBlockFetch(
(A$)+1):c%=a%!8:$c%=A$:
shell_SpriteRename(qB%,YA$,ZA$):
46,512+26,qB%,
shell_SpriteGetPtr(qB%,YA$),ZA$:
shell_SpriteAreaSave(qB%,F$):
46,512+&C,qB%,F$:
shell_EnsurePoll:
:AA%=
shell_Poll_I(0,_U%!&94):
shell_Action(AA%):
AA%=0:
shell_WimpGetVersion:=_U%!316
shell_OSCheckVersion(EF%):=
shell_OSModuleCheckVersion("UtilityModule",EF%)
shell_OSModuleCheckVersion(aA$,a):
a%,ZB%,O$:a%=
shell_HeapBlockFetch(256):
("Set Module$Check Y"):
("RMEnsure "+aA$+" "+
a+" Set Module$Check N"):
35,"Module$Check",a%,256,0,0
,,ZB%:a%?ZB%=&D:
("Unset Module$Check"):O$=$a%
shell_HeapBlockReturn(a%):
O$="N"
shell_MessageSendDataLoad(u%,Q$):
x%:x%=
shell_HeapBlockFetch(256):x%!0=256:x%!4=0:x%!&C=0:x%!16=5:x%!20=0:x%!28=0:x%!32=0:x%!36=0:x%!40=u%:$(x%+44)=Q$+
&400E7,17,x%,0:
shell_HeapBlockReturn(x%):
shell_MenuMakeFromFile(R$,bA$,h$):
h%,X%,B$,o%:
shell_FileExists(h$)
shell_MenuNew(R$):X%=
(h$):
#X%:o%=
shell_MenuAdd(h%,B$,bA$):
shell_BinarySearch(_search_term$,cA$,g$,FF%,WD%):
_pos%,kA%,_wp$,mC%,rF%,YD%,ZD%,ZE%,m%,aD%:WD%+=1:aD%=
:kA%=WD%:mC%=0:_pos%=kA%
2:ZD%=FF%-1:YD%=WD%:
:_wp$=
("FN"+cA$+"(_pos%)"):bD%=_pos%:
_search_term$=_wp$
("FN"+g$+"(_search_term$,_wp$)")
+YD%=_pos%:kA%=_pos%-ZD%:_pos%=kA%
2+mC%
ZD%=_pos%:mC%=_pos%:kA%=YD%-_pos%:_pos%=kA%
2+mC%
ZE%=bD%
!ZE%=bD%:
shell_IconLastClicked:=_U%!32
shell_MenuGetNrItems(TA%):
k%,BA%,aE%:
&45BC7,TA%
k%:k%+=28:
:BA%=(k%?0
&80):aE%+=1:k%+=24:
BA%:=aE%
shell_MenuGetNrDotted(TA%):
k%,BA%,aC%:
&45BC7,TA%
k%:k%+=28:
:BA%=(k%?0
&80):
(k%?0
aC%+=1
k%+=24:
BA%=-1:=aC%
shell_MenuGetItemHandler(TA%,IC%):
UA%,f%,JA$:UA%=
shell_HeapBlockFetch(8):UA%!0=IC%:UA%!4=-1:
&45BC4,TA%,UA%
JA$=""
JA$=$(f%)
shell_HeapBlockReturn(UA%):=JA$
shell_MenuGetItemText(TA%,IC%):
UA%,f%,H$:UA%=
shell_HeapBlockFetch(8):UA%!0=IC%:UA%!4=-1:
&45BC4,TA%,UA%
,,f%:H$=$(f%!&C):
shell_HeapBlockReturn(UA%):=H$
shell_MenuGetItemHandle(TA%,IC%):
UA%,f%,h%:UA%=
shell_HeapBlockFetch(8):UA%!0=IC%:UA%!4=-1:
&45BC4,TA%,UA%
,,f%:h%=f%!8:
shell_HeapBlockReturn(UA%):=h%
shell_MenuGetItemHeight(TA%):
&45BC7,TA%
k%:=k%!20
shell_MenuCalculateHeight(TA%):
QA%:QA%=
shell_MenuGetNrItems(TA%)*
shell_MenuGetItemHeight(TA%):=QA%+(
shell_MenuGetNrDotted(TA%)*24)
shell_MenuSortItems(k%,eA$,NF%,DC%,eD%):
fD%:fD%=
shell_MenuGetNrItems(k%)-1:_shell_MS_handle%=k%:
eD%>fD%
eD%=fD%
&406C0:
shell_QuickSort(eA$,"_shell_MS_swap",NF%,0,eD%):
&406C1:
shell_QuickSort(g$,j$,_asc%,_start%,_end%):
_lo%,_h%,_F%,_temp%,o%:_lo%=_start%:_hi%=_end%:_F%=
:_temp%=_lo%-1+
(_hi%+1-_lo%):o%=
("FN"+j$+"(_lo%,_temp%)"):
_asc%=0
("FN"+g$+"(_lo%,_hi%)")
((o%=
("FN"+j$+"(_lo%,_hi%)"):_F%=
("FN"+g$+"(_hi%,_lo%)")
-(o%=
("FN"+j$+"(_hi%,_lo%)"):_F%=
_hi%=_hi%-1
_lo%=_lo%+1
_lo%=_hi%:
_start%<_lo%-1
shell_QuickSort(g$,j$,_asc%,_start%,_lo%-1)
_hi%+1<_end%
shell_QuickSort(g$,j$,_asc%,_hi%+1,_end%)
_shell_MS_swap(nC%,oC%):
k$,l$,bE%,cE%:k$=
shell_MenuGetItemText(_shell_MS_handle%,nC%):l$=
shell_MenuGetItemText(_shell_MS_handle%,oC%):bE%=
shell_MenuGetItemHandle(_shell_MS_handle%,nC%):cE%=
shell_MenuGetItemHandle(_shell_MS_handle%,oC%)
shell_MenuPutData(bE%,l$):
shell_MenuPutData(cE%,k$):=0
_shell_MS_comp(nC%,oC%):
k$,l$:k$=
shell_MenuGetItemText(_shell_MS_handle%,nC%):l$=
shell_MenuGetItemText(_shell_MS_handle%,oC%):
shell_WindowSetTitleRightJust(
s%,NA%,h%,KC%:KC%=
shell_WindowIsOpen(b%):s%=
shell_HeapBlockFetch(&64+(
shell_WindowCountIcons(b%)*32)):!s%=b%:
&400CC,,s%:NA%=s%!60:
(1<<3))
shell_Tracef0("WindowSetTitleRightJust:title flags = &"+
~NA%):
shell_Tracef0("WindowSetTitleRightJust:Horizontally centred bit set.."):
shell_Tracef0("WindowSetTitleRightJust:Unsetting horizontally centred bit.."):NA%=NA%
(1<<3)
shell_Tracef0("WindowSetTitleRightJust:title flags = &"+
~NA%)
shell_Tracef0("WindowSetTitleRightJust:Horizontally centred bit NOT set..")
shell_Tracef0("WindowSetTitleRightJust:Setting right justified bit.."):NA%=NA%
(1<<9):s%!60=NA%:
&400C3,,s%:
&400C1,,s%+4
b%<>h%
shell_Tracef0("WindowSetTitleRightJust:Updating window handle..."):
shell_UpdateWindowHandle(b%,h%):b%=h%
shell_OpenWindow(h%,0,0)
shell_HeapBlockReturn(s%):
shell_WindowSetTitleCentreJust(
s%,NA%,h%,KC%:KC%=
shell_WindowIsOpen(b%):s%=
shell_HeapBlockFetch(&64+(
shell_WindowCountIcons(b%)*32)):!s%=b%:
&400CC,,s%:NA%=s%!60:
shell_Tracef0("WindowSetTitleCentreJust:title flags = &"+
~NA%)
shell_Tracef0("WindowSetTitleCentreJust:t_flags% AND (1 << 3) = "+
~(NA%
(1<<3))):
(1<<3))=0
shell_Tracef0("WindowSetTitleCentreJust:Horizontally centred bit not set.."):
shell_Tracef0("WindowSetTitleCentreJust:Setting horizontally centred bit.."):NA%=NA%
(1<<3):
shell_Tracef0("WindowSetTitleCentreJust:title flags = &"+
~NA%):s%!60=NA%
&400C3,,s%:
&400C1,,s%+4
b%<>h%
shell_Tracef0("WindowSetTitleCentreJust:Updating window handle..."):
shell_UpdateWindowHandle(b%,h%):b%=h%
shell_OpenWindow(h%,0,0)
shell_HeapBlockReturn(s%):
shell_IconGetSelectedIcons(b%,nB%,
eE%:eE%=(nB%<<16)+(1<<21):
&400D6,b%,n%,eE%,(nB%<<16)+(1<<21):
shell_GetLastMouseButton:=_U%!320
shell_GetLastWindowClicked:=_U%!28
shell_GetLastIconClicked:=_U%!32
shell_IconIndirSize(jA%,i%,GC%,X%):
bA%,fE%,e%,VC%:
&800100)=256
"bA%=GC%!8:
(GC%!4<>-1)
AfE%=GC%!4:
#X%=jA%+fE%:e%=0:
:VC%=
#X%:e%+=1:
VC%<32:bA%+=+e%
bA%=0
:=bA%
shell_StrongHlpChkFiles(G$):
shell_FileExists(G$+".HelpData")
<NB%=-1:
shell_MessageOneArg("SHELLMSG32","HelpData")
shell_FileExists(G$+".Index")
9NB%=-1:
shell_MessageOneArg("SHELLMSG32","Index")
shell_CaretMoveCaret(b%,AA%):
z%,gE%,e%,f%,OB%:e%=0:f%=0:z%=
shell_HeapBlockFetch(&800):
&400D3,,z%:
z%!4<>-1
<gE%=z%!4:
&400D6,b%,z%,&40E000,&E000:
z%!e%=gE%
f%=e%
e%+=4:
z%!e%=-1:
0:OB%=!z%
1:OB%=z%!(e%-4)
z%!(f%+4)<>-1
OB%=z%!(f%+4)
OB%=!z%
OB%=z%!(f%-4)
OB%=z%!(e%-4)
&400D2,b%,OB%,-1,-1,-1,
shell_IconGetData(b%,OB%))
shell_HeapBlockReturn(z%):
shell_CaretPutFirstIcon(b%):
shell_CaretMoveCaret(b%,0):
shell_CaretPutLastIcon(b%):
shell_CaretMoveCaret(b%,1):
shell_CaretPutNextIcon(b%):
shell_CaretMoveCaret(b%,2):
shell_CaretPutPrevIcon(b%):
shell_CaretMoveCaret(b%,3):
shell_TemplateFileInfo(F$,
BA%):
EA%,iD%,qC%:
CA%,X%,TC%,BE%:
e%,VC%,iE%,AB%,rC%,i%:EA%=0:iA%=0:iD%=0:qC%=0:BA%=0:
shell_FileExists(F$)
BA%=-1
shell_FileType(F$)<>&FEC
BA%=-2
BA%=0
?UCA%=
shell_HeapBlockFetch(&D):X%=
(F$):
#X%=16:
&C,4,X%,CA%,4:jA%=!CA%:
jA%>0
iA%+=1:kD%=0:
&C,4,X%,CA%,4:TC%=!CA%:
&C,4,X%,CA%,4:BE%=!CA%:
&C,4,X%,CA%,&C:iE%=
#X%=jA%+56:
&C,4,X%,CA%,4:i%=!CA%:
#X%=jA%+72:
&C,4,X%,CA%,&C:kD%+=
shell_IconIndirSize(jA%,i%,CA%,X%):
#X%=jA%+84:
&C,4,X%,CA%,4:AB%=!CA%:
AB%>0
rC%=0
AB%-1:
#X%=jA%+88+(rC%*32)+16:
&C,4,X%,CA%,4:i%=!CA%:
#X%=jA%+88+(rC%*32)+20:
&C,4,X%,CA%,&C:kD%+=
shell_IconIndirSize(jA%,i%,CA%,X%):
#X%=iE%:iD%+=kD%:
TC%>qC%
qC%=TC%
jA%=0:
shell_HeapBlockReturn(CA%):iB%=qC%+iD%
RO3_Present:
a%,ZB%,O$:a%=
shell_HeapBlockFetch(256):
("Set RO3$Check Y"):
("RMEnsure UtilityModule 3.00 Set RO3$Check N"):
35,"RO3$Check",a%,256,0,0
,,ZB%:a%?ZB%=&D:
("Unset RO3$Check"):O$=$a%:
shell_HeapBlockReturn(a%):
O$="N"
shell_WindowCountIcons(b%):
LB%,mD%,AB%:
(_U%!&64
1<<&A)
shell_Tracef0("WindowCountIcons:RISC OS 3 detected.."):
b%=-1
b%=-2
yLB%=
shell_HeapBlockFetch(88):!LB%=b%:
&400CC,,LB%+1:AB%=LB%!88:
shell_Tracef0("WindowCountIcons:nr_icons% = "+
shell_Tracef0("WindowCountIcons:RISC OS 3 NOT found.."):LB%=
shell_HeapBlockFetch(6000):
$!LB%=b%:
&400CC,,LB%:AB%=LB%!88
shell_Tracef0("WindowCountIcons:nr_icons% = "+
shell_HeapBlockReturn(LB%):=AB%